test_frozen.py 663 Bytes
Newer Older
1 2
# Test the frozen module defined in frozen.c.

3
from test.test_support import TestFailed
4 5 6 7 8
import sys, os

try:
    import __hello__
except ImportError, x:
9
    raise TestFailed, "import __hello__ failed:" + str(x)
10 11 12 13

try:
    import __phello__
except ImportError, x:
14
    raise TestFailed, "import __phello__ failed:" + str(x)
15 16 17 18

try:
    import __phello__.spam
except ImportError, x:
19
    raise TestFailed, "import __phello__.spam failed:" + str(x)
20

21 22 23 24 25 26 27
if sys.platform != "mac":  # On the Mac this import does succeed.
    try:
        import __phello__.foo
    except ImportError:
        pass
    else:
        raise TestFailed, "import __phello__.foo should have failed"