diff --git a/foolscap/test/test_banana.py b/foolscap/test/test_banana.py
index 513ce7a..449eb42 100644
a
|
b
|
from foolscap.banana import int2b128, long_to_bytes |
16 | 16 | |
17 | 17 | import StringIO |
18 | 18 | import sets, struct |
19 | | from decimal import Decimal, Inf, NaN |
| 19 | from decimal import Decimal |
20 | 20 | |
21 | 21 | #log.startLogging(sys.stderr) |
22 | 22 | |
… |
… |
class ThereAndBackAgain(TestBananaMixin, unittest.TestCase): |
1680 | 1680 | d.addCallback(lambda res: self.looptest(Decimal("-123.456"))) |
1681 | 1681 | d.addCallback(lambda res: self.looptest(Decimal("0.000003"))) |
1682 | 1682 | d.addCallback(lambda res: self.looptest(Decimal("-0.000003"))) |
1683 | | d.addCallback(lambda res: self.looptest(Decimal(Inf))) |
1684 | | d.addCallback(lambda res: self.looptest(Decimal(-Inf))) |
| 1683 | d.addCallback(lambda res: self.looptest(Decimal('Inf'))) |
| 1684 | d.addCallback(lambda res: self.looptest(Decimal('-Inf'))) |
1685 | 1685 | # NaN is a bit weird: by definition, NaN != NaN. So we need to make |
1686 | 1686 | # sure it serializes, and that str(new) == str(old), but we don't |
1687 | 1687 | # check that new == old. |
1688 | | d.addCallback(lambda res: self.loop(Decimal(NaN))) |
| 1688 | d.addCallback(lambda res: self.loop(Decimal('NaN'))) |
1689 | 1689 | def _check_NaN(new_NaN): |
1690 | | self.failUnlessEqual(str(new_NaN), str(Decimal(NaN))) |
| 1690 | self.failUnlessEqual(str(new_NaN), str(Decimal('NaN'))) |
1691 | 1691 | d.addCallback(_check_NaN) |
1692 | 1692 | return d |
1693 | 1693 | |