diff options
author | John Wiegley <johnw@newartisans.com> | 2007-05-04 09:53:05 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:38:37 -0400 |
commit | 0214a136c2b21b3cff3dfc94095d2badc3136b1b (patch) | |
tree | 94807dcc6ee60f650f880f5421367847c3b96192 /tests/python | |
parent | 6c7e35dc17504c41bb177b3d1327c6b6cee4017d (diff) | |
download | fork-ledger-0214a136c2b21b3cff3dfc94095d2badc3136b1b.tar.gz fork-ledger-0214a136c2b21b3cff3dfc94095d2badc3136b1b.tar.bz2 fork-ledger-0214a136c2b21b3cff3dfc94095d2badc3136b1b.zip |
Work to get Python tests running again.
Diffstat (limited to 'tests/python')
-rw-r--r-- | tests/python/numerics/BasicAmount.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/tests/python/numerics/BasicAmount.py b/tests/python/numerics/BasicAmount.py index bdc7dbe9..4dfb3a7a 100644 --- a/tests/python/numerics/BasicAmount.py +++ b/tests/python/numerics/BasicAmount.py @@ -1,6 +1,4 @@ import sys -sys.path.append("/home/johnw/src/ledger") -sys.path.append("/home/johnw/Products/ledger") import unittest import exceptions @@ -362,7 +360,7 @@ class BasicAmountTestCase(unittest.TestCase): def testIntegerConversion(self): x1 = amount(123456) - self.assertEqual(True, bool(x1)) + self.assertTrue(x1) self.assertEqual(123456, int(x1)) self.assertEqual(123456.0, float(x1)) self.assertEqual("123456", x1.to_string()) @@ -373,7 +371,7 @@ class BasicAmountTestCase(unittest.TestCase): def testFractionalConversion(self): x1 = amount(1234.56) - self.assertEqual(True, not (not x1)) + self.assertTrue(x1) self.assertEqual(1234, int(x1)) self.assertEqual(1234.56, float(x1)) self.assertEqual("1234.56", x1.to_string()) @@ -432,8 +430,8 @@ class BasicAmountTestCase(unittest.TestCase): x1 = amount("1234") x2 = amount("1234.56") - self.assertTrue(not x0) - self.assertTrue(x1 ) + self.assertFalse(x0) + self.assertTrue(x1) self.assertTrue(x2) self.assertTrue(x0.valid()) @@ -444,12 +442,12 @@ class BasicAmountTestCase(unittest.TestCase): x0 = amount() x1 = amount("0.000000000000000000001") - self.assertTrue(not x0) + self.assertFalse(x0) self.assertTrue(x1) self.assertTrue(x0.zero()) self.assertTrue(x0.realzero()) - self.assertTrue(not x1.zero()) - self.assertTrue(not x1.realzero()) + self.assertFalse(x1.zero()) + self.assertFalse(x1.realzero()) self.assertTrue(x0.valid()) self.assertTrue(x1.valid()) @@ -491,7 +489,7 @@ class BasicAmountTestCase(unittest.TestCase): x3 = amount("1") x4 = amount("-1") - self.assertTrue(not x0.sign()) + self.assertEqual(x0.sign(), 0) self.assertTrue(x1.sign() > 0) self.assertTrue(x2.sign() < 0) self.assertTrue(x3.sign() > 0) |