summaryrefslogtreecommitdiff
path: root/tests/python/corelib/numerics
diff options
context:
space:
mode:
Diffstat (limited to 'tests/python/corelib/numerics')
-rw-r--r--tests/python/corelib/numerics/BasicAmount.py6
-rw-r--r--tests/python/corelib/numerics/CommodityAmount.py6
2 files changed, 10 insertions, 2 deletions
diff --git a/tests/python/corelib/numerics/BasicAmount.py b/tests/python/corelib/numerics/BasicAmount.py
index 2ce532d9..bfb67cf2 100644
--- a/tests/python/corelib/numerics/BasicAmount.py
+++ b/tests/python/corelib/numerics/BasicAmount.py
@@ -4,6 +4,12 @@ import exceptions
from ledger import amount
class BasicAmountTestCase(unittest.TestCase):
+ def setUp(self):
+ amount.initialize()
+
+ def tearDown(self):
+ amount.shutdown()
+
def testConstructors(self):
x0 = amount()
x1 = amount(123456)
diff --git a/tests/python/corelib/numerics/CommodityAmount.py b/tests/python/corelib/numerics/CommodityAmount.py
index e29d091a..923fab69 100644
--- a/tests/python/corelib/numerics/CommodityAmount.py
+++ b/tests/python/corelib/numerics/CommodityAmount.py
@@ -8,16 +8,18 @@ from ledger import amount
internalAmount = amount.exact
-
class CommodityAmountTestCase(unittest.TestCase):
def setUp(self):
+ amount.initialize()
+
# Cause the display precision for dollars to be initialized to 2.
x1 = amount("$1.00")
self.assertTrue(x1)
amount.full_strings = True # makes error reports from UnitTests accurate
-
+
def tearDown(self):
amount.full_strings = False
+ amount.shutdown()
def assertValid(self, amt):
self.assertTrue(amt.valid())