]> granicus.if.org Git - python/commitdiff
Test cases for examples of ext call error handling.
authorJeremy Hylton <jeremy@alum.mit.edu>
Wed, 11 Apr 2001 13:53:35 +0000 (13:53 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Wed, 11 Apr 2001 13:53:35 +0000 (13:53 +0000)
Fix to SF bug #414743 based on Michael Hudson's patch #414750.

Lib/test/output/test_extcall
Lib/test/test_extcall.py

index 64754cfc811f1cfbb01ef2233d29317044081336..58f52d4510aaf251e7ec70b840d12adb93f94d96 100644 (file)
@@ -25,7 +25,12 @@ g() got multiple values for keyword argument 'b'
 f() keywords must be strings
 h() got an unexpected keyword argument 'e'
 h() argument after * must be a sequence
+dir() argument after * must be a sequence
+None object argument after * must be a sequence
 h() argument after ** must be a dictionary
+dir() argument after ** must be a dictionary
+None object argument after ** must be a dictionary
+dir() got multiple values for keyword argument 'b'
 3 512 1
 3
 3
index 9e6da626bc43bd96221256994f6c7de785aa3df7..472090136d51ce43fb926df95fad0ce1ae4e46b3 100644 (file)
@@ -137,6 +137,20 @@ except TypeError, err:
 else:
     print "should raise TypeError: * argument must be a tuple"
 
+try:
+    dir(*h)
+except TypeError, err:
+    print err
+else:
+    print "should raise TypeError: * argument must be a tuple"
+
+try:
+    None(*h)
+except TypeError, err:
+    print err
+else:
+    print "should raise TypeError: * argument must be a tuple"
+
 try:
     h(**h)
 except TypeError, err:
@@ -144,6 +158,27 @@ except TypeError, err:
 else:
     print "should raise TypeError: ** argument must be a dictionary"
 
+try:
+    dir(**h)
+except TypeError, err:
+    print err
+else:
+    print "should raise TypeError: ** argument must be a dictionary"
+
+try:
+    None(**h)
+except TypeError, err:
+    print err
+else:
+    print "should raise TypeError: ** argument must be a dictionary"
+
+try:
+    dir(b=1,**{'b':1})
+except TypeError, err:
+    print err
+else:
+    print "should raise TypeError: dir() got multiple values for keyword argument 'b'"
+
 def f2(*a, **b):
     return a, b