mirror of
https://github.com/python/cpython
synced 2024-09-20 07:21:46 +00:00
Test new __import__ module, test reload of built-in module, test
has_key() on empty dictionary
This commit is contained in:
parent
5505d56f08
commit
eecf035aa2
|
@ -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)'
|
||||
|
|
|
@ -148,8 +148,8 @@ def __getitem__(self, i):
|
|||
|
||||
|
||||
print 'reload'
|
||||
#import strop
|
||||
#reload(strop)
|
||||
import marshal
|
||||
reload(marshal)
|
||||
import string
|
||||
reload(string)
|
||||
import sys
|
||||
|
|
|
@ -165,6 +165,7 @@ def revcmp(a, b): return cmp(b, a)
|
|||
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)'
|
||||
|
|
|
@ -54,6 +54,7 @@ XXX Not yet implemented
|
|||
test_builtin
|
||||
4. Built-in functions
|
||||
test_b1
|
||||
__import__
|
||||
abs
|
||||
apply
|
||||
callable
|
||||
|
|
Loading…
Reference in a new issue