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/corelib/numerics/CommodityAmount.py | |
parent | 176b3044e355398a0c31e0c42a3cd7b8a2e3f3e5 (diff) | |
download | ledger-0a6b5726ec3bf402a953ea8a03b98ecbf4b90b0c.tar.gz ledger-0a6b5726ec3bf402a953ea8a03b98ecbf4b90b0c.tar.bz2 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/corelib/numerics/CommodityAmount.py')
-rw-r--r-- | tests/python/corelib/numerics/CommodityAmount.py | 24 |
1 files changed, 6 insertions, 18 deletions
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) |