[Python-checkins] CVS: python/dist/src/Lib/test test_frozen.py,NONE,1.1
Guido van Rossum
gvanrossum@users.sourceforge.net
Thu, 18 Oct 2001 11:49:39 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv9628/Lib/test
Added Files:
test_frozen.py
Log Message:
Fix the frozen bytecode for __hello__ (betcha didn't know that existed
:-).
Add a test that prevents the __hello__ bytecode from going stale
unnoticed again.
The test also tests the loophole noted in SF bug #404545. This test
will fail right now; I'll check in the fix in a minute.
--- NEW FILE: test_frozen.py ---
# Test the frozen module defined in frozen.c.
from test_support import TestFailed
import sys, os
try:
import __hello__
except ImportError, x:
raise TestFailed, "import __hello__ failed:", x
try:
import __phello__
except ImportError, x:
raise TestFailed, "import __phello__ failed:", x
try:
import __phello__.spam
except ImportError, x:
raise TestFailed, "import __phello__.spam failed:", x
try:
import __phello__.foo
except ImportError:
pass
else:
raise TestFailed, "import __phello__.foo should have failed"