Show More
@@ -85,11 +85,17 b' class PromptTests(unittest.TestCase):' | |||
|
85 | 85 | u = u'ünicødé' |
|
86 | 86 | b = u.encode('utf8') |
|
87 | 87 | lz = LazyEvaluate(lambda : b) |
|
88 | if py3compat.PY3: | |
|
89 | 88 |
|
|
90 | 89 |
|
|
91 | else: | |
|
92 | self.assertEquals(str(lz), b) | |
|
90 | if not py3compat.PY3: | |
|
93 | 91 | self.assertRaises(UnicodeDecodeError, unicode, lz) |
|
94 | self.assertRaises(UnicodeDecodeError, format, lz) | |
|
92 | ||
|
93 | def test_lazy_eval_float(self): | |
|
94 | f = 0.503 | |
|
95 | lz = LazyEvaluate(lambda : f) | |
|
96 | ||
|
97 | self.assertEquals(str(lz), str(f)) | |
|
98 | self.assertEquals(unicode(lz), unicode(f)) | |
|
99 | self.assertEquals(format(lz), str(f)) | |
|
100 | self.assertEquals(format(lz, '.1'), '0.5') | |
|
95 | 101 |
General Comments 0
You need to be logged in to leave comments.
Login now