diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-03-30 18:56:19 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-03-30 18:56:19 (GMT) |
commit | 503ab33e54f5edb3c8b925c0d7b22c892084c5db (patch) | |
tree | c2384275002fd30736f559d6d5f0a091663a6401 /Lib/test/test_decimal.py | |
parent | 25cd7eb9a14cb646e58e315ebfafe867862a705b (diff) | |
download | cpython-503ab33e54f5edb3c8b925c0d7b22c892084c5db.zip cpython-503ab33e54f5edb3c8b925c0d7b22c892084c5db.tar.gz cpython-503ab33e54f5edb3c8b925c0d7b22c892084c5db.tar.bz2 |
Merged revisions 79502 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r79502 | antoine.pitrou | 2010-03-30 20:49:45 +0200 (mar., 30 mars 2010) | 4 lines
Issue #8248: Add some tests for the bool type. Patch by Gregory Nofi.
........
Diffstat (limited to 'Lib/test/test_decimal.py')
-rw-r--r-- | Lib/test/test_decimal.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py index dada733..360a5e8 100644 --- a/Lib/test/test_decimal.py +++ b/Lib/test/test_decimal.py @@ -472,6 +472,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 |