From 6e8c75755a1bb0cd8fb79944a8617802aa0c4e44 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sun, 4 Oct 2009 20:19:21 +0000 Subject: Merged revisions 74865,75175,75180 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r74865 | georg.brandl | 2009-09-17 02:49:37 -0500 (Thu, 17 Sep 2009) | 1 line #6912: add "with" block support to pindent. ........ r75175 | georg.brandl | 2009-10-01 15:11:14 -0500 (Thu, 01 Oct 2009) | 1 line Fix some weird whitespace and two other overlong lines. ........ r75180 | georg.brandl | 2009-10-01 15:59:31 -0500 (Thu, 01 Oct 2009) | 1 line #7031: Add TestCase.assertIsInstance and negated method. ........ --- Lib/test/test_unittest.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Lib/test/test_unittest.py') diff --git a/Lib/test/test_unittest.py b/Lib/test/test_unittest.py index 108802db3d..120a90d759 100644 --- a/Lib/test/test_unittest.py +++ b/Lib/test/test_unittest.py @@ -2510,6 +2510,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'} -- cgit v1.2.1