From d8498372037a4d0c272547ae48046b2182bcd4b1 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 7 May 2007 10:27:21 +0000 Subject: Major restructuring of the value_t class. --- tests/python/numerics/BasicAmount.py | 3 ++- tests/python/numerics/CommodityAmount.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'tests/python') diff --git a/tests/python/numerics/BasicAmount.py b/tests/python/numerics/BasicAmount.py index 9e2c1b3e..9654f6a7 100644 --- a/tests/python/numerics/BasicAmount.py +++ b/tests/python/numerics/BasicAmount.py @@ -372,7 +372,8 @@ class BasicAmountTestCase(unittest.TestCase): x1 = amount(1234.56) self.assertTrue(x1) - self.assertEqual(1234, int(x1)) + self.assertRaises(exceptions.ArithmeticError, amount.to_long, x1) + self.assertEqual(1234, x1.to_long(True)) self.assertEqual(1234.56, float(x1)) self.assertEqual("1234.56", x1.to_string()) self.assertEqual("1234.56", x1.quantity_string()) diff --git a/tests/python/numerics/CommodityAmount.py b/tests/python/numerics/CommodityAmount.py index 0edd9fad..3b7c98a9 100644 --- a/tests/python/numerics/CommodityAmount.py +++ b/tests/python/numerics/CommodityAmount.py @@ -449,7 +449,8 @@ class CommodityAmountTestCase(unittest.TestCase): x1 = amount("$1234.56") self.assertEqual(True, bool(x1)) - self.assertEqual(1234, int(x1)) + self.assertRaises(exceptions.ArithmeticError, amount.to_long, x1) + self.assertEqual(1234, x1.to_long(True)) self.assertEqual(1234.56, float(x1)) self.assertEqual("$1234.56", x1.to_string()) self.assertEqual("1234.56", x1.quantity_string()) -- cgit v1.2.3