summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_bool.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2007-08-14 21:57:32 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2007-08-14 21:57:32 (GMT)
commitff398c6f957fcd0e55aa57c0eaa5c1d24c5bc2f1 (patch)
tree1fb5dc2dfb074e6b0d10c167b3ab5deeab2ef4f3 /Lib/test/test_bool.py
parent3eed76522389d55248a71aa8c83203aa3ae0873b (diff)
downloadcpython-ff398c6f957fcd0e55aa57c0eaa5c1d24c5bc2f1.zip
cpython-ff398c6f957fcd0e55aa57c0eaa5c1d24c5bc2f1.tar.gz
cpython-ff398c6f957fcd0e55aa57c0eaa5c1d24c5bc2f1.tar.bz2
Format bools properly in %d.
Diffstat (limited to 'Lib/test/test_bool.py')
-rw-r--r--Lib/test/test_bool.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_bool.py b/Lib/test/test_bool.py
index 7a9022e..bbaea85 100644
--- a/Lib/test/test_bool.py
+++ b/Lib/test/test_bool.py
@@ -163,6 +163,12 @@ class BoolTest(unittest.TestCase):
self.assertIs(bool(""), False)
self.assertIs(bool(), False)
+ def test_format(self):
+ self.assertEqual("%d" % False, "0")
+ self.assertEqual("%d" % True, "1")
+ self.assertEqual("%x" % False, "0")
+ self.assertEqual("%x" % True, "1")
+
def test_hasattr(self):
self.assertIs(hasattr([], "append"), True)
self.assertIs(hasattr([], "wobble"), False)