Guido van Rossum | 4114a4a | 2001-10-18 18:49:37 +0000 | [diff] [blame] | 1 | # Test the frozen module defined in frozen.c. |
| 2 | |
Barry Warsaw | 408b6d3 | 2002-07-30 23:27:12 +0000 | [diff] [blame] | 3 | from test.test_support import TestFailed |
Guido van Rossum | 4114a4a | 2001-10-18 18:49:37 +0000 | [diff] [blame] | 4 | import sys, os |
| 5 | |
| 6 | try: |
| 7 | import __hello__ |
| 8 | except ImportError, x: |
Finn Bock | 218c5f9 | 2002-11-01 11:33:00 +0000 | [diff] [blame^] | 9 | raise TestFailed, "import __hello__ failed:" + str(x) |
Guido van Rossum | 4114a4a | 2001-10-18 18:49:37 +0000 | [diff] [blame] | 10 | |
| 11 | try: |
| 12 | import __phello__ |
| 13 | except ImportError, x: |
Finn Bock | 218c5f9 | 2002-11-01 11:33:00 +0000 | [diff] [blame^] | 14 | raise TestFailed, "import __phello__ failed:" + str(x) |
Guido van Rossum | 4114a4a | 2001-10-18 18:49:37 +0000 | [diff] [blame] | 15 | |
| 16 | try: |
| 17 | import __phello__.spam |
| 18 | except ImportError, x: |
Finn Bock | 218c5f9 | 2002-11-01 11:33:00 +0000 | [diff] [blame^] | 19 | raise TestFailed, "import __phello__.spam failed:" + str(x) |
Guido van Rossum | 4114a4a | 2001-10-18 18:49:37 +0000 | [diff] [blame] | 20 | |
| 21 | try: |
| 22 | import __phello__.foo |
| 23 | except ImportError: |
| 24 | pass |
| 25 | else: |
| 26 | raise TestFailed, "import __phello__.foo should have failed" |