]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Test new __import__ module, test reload of built-in module, test
authorGuido van Rossum <guido@python.org>
Fri, 30 Dec 1994 17:17:46 +0000 (17:17 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 30 Dec 1994 17:17:46 +0000 (17:17 +0000)
has_key() on empty dictionary

Lib/test/test_b1.py
Lib/test/test_b2.py
Lib/test/test_types.py
Lib/test/testall.out

index 3fab517c0ff1470a9792381697a15ffdb838871a..356edd2813ba905d745c07121ab415db589ca3ae 100644 (file)
@@ -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)'
index aacb4035cc097c74ee637892c7d11c8d4c37ef91..99637794d8264d4d9457d8b2fc8366741f35e364 100644 (file)
@@ -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
index 6a3f7729ffb201ace71581cb77c2f1bbdeeb84cb..51c76dc6d988d1a8bde74dd07dab17a7bc3e1643 100644 (file)
@@ -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)'
index 38586372d1b40a6acf60e3c13ea91a88c4159da2..709580c932f628949c77894b1f555eee8aabffe4 100644 (file)
@@ -54,6 +54,7 @@ XXX Not yet implemented
 test_builtin
 4. Built-in functions
 test_b1
+__import__
 abs
 apply
 callable