]> asedeno.scripts.mit.edu Git - bluechips.git/blob - bluechips/tests/model/test_currency.py
more test coverage
[bluechips.git] / bluechips / tests / model / test_currency.py
1 from unittest import TestCase
2 from bluechips.model import types
3
4 class TestCurrency(TestCase):
5     def setUp(self):
6         self.c = types.Currency('12.34')
7
8     def test_currency_float(self):
9         assert float(self.c) == 1234.
10
11     def test_currency_int(self):
12         val = int(self.c)
13         assert val == 1234
14         assert type(val) == int
15
16     def test_currency_long(self):
17         val = long(self.c)
18         assert val == 1234
19         assert type(val) == long