diff options
author | Guido van Rossum <guido@python.org> | 1994-12-30 17:17:46 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1994-12-30 17:17:46 (GMT) |
commit | eecf035aa209cedb4ede08b527120ba3946a0c96 (patch) | |
tree | ceeb0c23f781539d1e203fa3d5def34900eb117b /Lib/test | |
parent | 5505d56f088b1637b7d3c10e97512ee9b9bc8cf0 (diff) | |
download | cpython-eecf035aa209cedb4ede08b527120ba3946a0c96.zip cpython-eecf035aa209cedb4ede08b527120ba3946a0c96.tar.gz cpython-eecf035aa209cedb4ede08b527120ba3946a0c96.tar.bz2 |
Test new __import__ module, test reload of built-in module, test
has_key() on empty dictionary
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_b1.py | 8 | ||||
-rw-r--r-- | Lib/test/test_b2.py | 4 | ||||
-rw-r--r-- | Lib/test/test_types.py | 1 | ||||
-rw-r--r-- | Lib/test/testall.out | 1 |
4 files changed, 12 insertions, 2 deletions
diff --git a/Lib/test/test_b1.py b/Lib/test/test_b1.py index 3fab517..356edd2 100644 --- a/Lib/test/test_b1.py +++ b/Lib/test/test_b1.py @@ -2,6 +2,14 @@ from test_support import * +print '__import__' +__import__('sys') +__import__('strop') +__import__('string') +try: __import__('spamspam') +except ImportError: pass +else: raise TestFailed, "__import__('spamspam') should fail" + print 'abs' if abs(0) <> 0: raise TestFailed, 'abs(0)' if abs(1234) <> 1234: raise TestFailed, 'abs(1234)' diff --git a/Lib/test/test_b2.py b/Lib/test/test_b2.py index aacb403..9963779 100644 --- a/Lib/test/test_b2.py +++ b/Lib/test/test_b2.py @@ -148,8 +148,8 @@ if reduce(lambda x, y: x+y, Squares(0), 0) != 0: print 'reload' -#import strop -#reload(strop) +import marshal +reload(marshal) import string reload(string) import sys diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py index 6a3f772..51c76dc 100644 --- a/Lib/test/test_types.py +++ b/Lib/test/test_types.py @@ -165,6 +165,7 @@ if a <> [2,1,0,-1,-2]: raise TestFailed, 'list sort with cmp func' print '6.6 Mappings == Dictionaries' d = {} if d.keys() <> []: raise TestFailed, '{}.keys()' +if d.has_key('a') <> 0: raise TestFailed, '{}.has_key(\'a\')' if len(d) <> 0: raise TestFailed, 'len({})' d = {'a': 1, 'b': 2} if len(d) <> 2: raise TestFailed, 'len(dict)' diff --git a/Lib/test/testall.out b/Lib/test/testall.out index 3858637..709580c 100644 --- a/Lib/test/testall.out +++ b/Lib/test/testall.out @@ -54,6 +54,7 @@ XXX Not yet implemented test_builtin 4. Built-in functions test_b1 +__import__ abs apply callable |