mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Issue #8248: Add some tests for the bool type. Patch by Gregory Nofi.
This commit is contained in:
parent
7e213255ce
commit
6032c25063
5 changed files with 35 additions and 0 deletions
|
@ -476,6 +476,12 @@ class DecimalExplicitConstructionTest(unittest.TestCase):
|
|||
self.assertRaises(ValueError, Decimal, (1, (4, 10, 4, 9, 1), 2) )
|
||||
self.assertRaises(ValueError, Decimal, (1, (4, 3, 4, 'a', 1), 2) )
|
||||
|
||||
def test_explicit_from_bool(self):
|
||||
self.assertIs(bool(Decimal(0)), False)
|
||||
self.assertIs(bool(Decimal(1)), True)
|
||||
self.assertEqual(Decimal(False), Decimal(0))
|
||||
self.assertEqual(Decimal(True), Decimal(1))
|
||||
|
||||
def test_explicit_from_Decimal(self):
|
||||
|
||||
#positive
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue