diff options
author | John Wiegley <johnw@newartisans.com> | 2007-04-19 20:31:46 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:38:28 -0400 |
commit | 0a6b5726ec3bf402a953ea8a03b98ecbf4b90b0c (patch) | |
tree | 0a2c2aca7100d045f491b03f0a5bda92378d3ef9 /tests/python | |
parent | 176b3044e355398a0c31e0c42a3cd7b8a2e3f3e5 (diff) | |
download | fork-ledger-0a6b5726ec3bf402a953ea8a03b98ecbf4b90b0c.tar.gz fork-ledger-0a6b5726ec3bf402a953ea8a03b98ecbf4b90b0c.tar.bz2 fork-ledger-0a6b5726ec3bf402a953ea8a03b98ecbf4b90b0c.zip |
Made the amount/balance/value interface a bit more rational; added
back a useless version of the register command (just to prove the
command sequence); and added smart XML semantics to the XPath
implementation so that nodes can be coerced to values.
Diffstat (limited to 'tests/python')
-rw-r--r-- | tests/python/corelib/numerics/BasicAmount.py | 13 | ||||
-rw-r--r-- | tests/python/corelib/numerics/CommodityAmount.py | 24 |
2 files changed, 8 insertions, 29 deletions
diff --git a/tests/python/corelib/numerics/BasicAmount.py b/tests/python/corelib/numerics/BasicAmount.py index df522f09..2ce532d9 100644 --- a/tests/python/corelib/numerics/BasicAmount.py +++ b/tests/python/corelib/numerics/BasicAmount.py @@ -42,10 +42,9 @@ class BasicAmountTestCase(unittest.TestCase): self.assertEqual(x5, x1) self.assertEqual(x6, x3) self.assertEqual(- x6, x9) - self.assertEqual(x3.negated(), x9) + self.assertEqual(x3.negate(), x9) - x10 = amount(x9) - x10.negate() + x10 = amount(x9.negate()) self.assertEqual(x3, x10) @@ -509,14 +508,6 @@ class BasicAmountTestCase(unittest.TestCase): self.assertEqual(amount(1234), abs(x1)) self.assertEqual(amount(1234), abs(x2)) - x0.abs() - x1.abs() - x2.abs() - - self.assertEqual(amount(), x0) - self.assertEqual(amount(1234), x1) - self.assertEqual(amount(1234), x2) - self.assertTrue(x0.valid()) self.assertTrue(x1.valid()) self.assertTrue(x2.valid()) diff --git a/tests/python/corelib/numerics/CommodityAmount.py b/tests/python/corelib/numerics/CommodityAmount.py index 417652e4..e29d091a 100644 --- a/tests/python/corelib/numerics/CommodityAmount.py +++ b/tests/python/corelib/numerics/CommodityAmount.py @@ -90,9 +90,9 @@ class CommodityAmountTestCase(unittest.TestCase): self.assertEqual(amount("-123.45€"), - x9) self.assertEqual(amount("123.45€"), - x10) - self.assertEqual(amount("$-123.45"), x1.negated()) - self.assertEqual(amount("$123.45"), x2.negated()) - self.assertEqual(amount("$123.45"), x3.negated()) + self.assertEqual(amount("$-123.45"), x1.negate()) + self.assertEqual(amount("$123.45"), x2.negate()) + self.assertEqual(amount("$123.45"), x3.negate()) self.assertEqual("$-123.45", (- x1).to_string()) self.assertEqual("$123.45", (- x2).to_string()) @@ -105,13 +105,9 @@ class CommodityAmountTestCase(unittest.TestCase): self.assertEqual("-123.45€", (- x9).to_string()) self.assertEqual("123.45€", (- x10).to_string()) - x1.negate() - x2.negate() - x3.negate() - - self.assertEqual(amount("$-123.45"), x1) - self.assertEqual(amount("$123.45"), x2) - self.assertEqual(amount("$123.45"), x3) + self.assertEqual(amount("$-123.45"), x1.negate()) + self.assertEqual(amount("$123.45"), x2.negate()) + self.assertEqual(amount("$123.45"), x3.negate()) self.assertValid(x1) self.assertValid(x2) @@ -613,14 +609,6 @@ class CommodityAmountTestCase(unittest.TestCase): self.assertEqual(amount("$1234.56"), abs(x1)) self.assertEqual(amount("$1234.56"), abs(x2)) - x0.abs() - x1.abs() - x2.abs() - - self.assertEqual(amount(), x0) - self.assertEqual(amount("$1234.56"), x1) - self.assertEqual(amount("$1234.56"), x2) - self.assertValid(x0) self.assertValid(x1) self.assertValid(x2) |