summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-10-01 20:59:31 (GMT)
committerGeorg Brandl <georg@python.org>2009-10-01 20:59:31 (GMT)
commitf895cf5d33f68bfd750e4cce19f3785096812e34 (patch)
tree8e87952720331e39333b6c5339c10983ab8830e0 /Lib/test
parent46cc46af07b3d2e495117f10e591cf1dfc77608e (diff)
downloadcpython-f895cf5d33f68bfd750e4cce19f3785096812e34.zip
cpython-f895cf5d33f68bfd750e4cce19f3785096812e34.tar.gz
cpython-f895cf5d33f68bfd750e4cce19f3785096812e34.tar.bz2
#7031: Add TestCase.assertIsInstance and negated method.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_unittest.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_unittest.py b/Lib/test/test_unittest.py
index 459334b..de687e2 100644
--- a/Lib/test/test_unittest.py
+++ b/Lib/test/test_unittest.py
@@ -2500,6 +2500,18 @@ class Test_TestCase(TestCase, TestEquality, TestHashing):
self.assertIsNot(thing, object())
self.assertRaises(self.failureException, self.assertIsNot, thing, thing)
+ def testAssertIsInstance(self):
+ thing = []
+ self.assertIsInstance(thing, list)
+ self.assertRaises(self.failureException, self.assertIsInstance,
+ thing, dict)
+
+ def testAssertNotIsInstance(self):
+ thing = []
+ self.assertNotIsInstance(thing, dict)
+ self.assertRaises(self.failureException, self.assertNotIsInstance,
+ thing, list)
+
def testAssertIn(self):
animals = {'monkey': 'banana', 'cow': 'grass', 'seal': 'fish'}