Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 81b21d7

Browse files
committed
test values and types of (True/False).(imag/real)
1 parent c58140c commit 81b21d7

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Lib/test/test_bool.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,16 @@ def __len__(self):
330330
except (Exception) as e_len:
331331
self.assertEqual(str(e_bool), str(e_len))
332332

333+
def test_real_and_imag(self):
334+
self.assertEqual(True.real, 1)
335+
self.assertEqual(True.imag, 0)
336+
self.assertIs(type(True.real), int)
337+
self.assertIs(type(True.imag), int)
338+
self.assertEqual(False.real, 0)
339+
self.assertEqual(False.imag, 0)
340+
self.assertIs(type(False.real), int)
341+
self.assertIs(type(False.imag), int)
342+
333343
def test_main():
334344
support.run_unittest(BoolTest)
335345

0 commit comments

Comments
 (0)