diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-05-25 14:21:46 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-05-25 14:21:46 (GMT) |
commit | 81b21d77668520f34f288fd21b8dc47809316c77 (patch) | |
tree | c80b5866a3744acdcaf8d0dc8cd1dc4aeb7be552 /Lib/test/test_bool.py | |
parent | c58140c55798f77bd003ae48b1cf50daf1727f66 (diff) | |
download | cpython-81b21d77668520f34f288fd21b8dc47809316c77.zip cpython-81b21d77668520f34f288fd21b8dc47809316c77.tar.gz cpython-81b21d77668520f34f288fd21b8dc47809316c77.tar.bz2 |
test values and types of (True/False).(imag/real)
Diffstat (limited to 'Lib/test/test_bool.py')
-rw-r--r-- | Lib/test/test_bool.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_bool.py b/Lib/test/test_bool.py index b296870..4bab28b 100644 --- a/Lib/test/test_bool.py +++ b/Lib/test/test_bool.py @@ -330,6 +330,16 @@ class BoolTest(unittest.TestCase): except (Exception) as e_len: self.assertEqual(str(e_bool), str(e_len)) + def test_real_and_imag(self): + self.assertEqual(True.real, 1) + self.assertEqual(True.imag, 0) + self.assertIs(type(True.real), int) + self.assertIs(type(True.imag), int) + self.assertEqual(False.real, 0) + self.assertEqual(False.imag, 0) + self.assertIs(type(False.real), int) + self.assertIs(type(False.imag), int) + def test_main(): support.run_unittest(BoolTest) |