diff options
Diffstat (limited to 'test.py')
-rw-r--r-- | test.py | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -220,6 +220,8 @@ class AmountTest(WebMockTestCase): | |||
220 | amount4 = portfolio.Amount("ETH", 0.0) | 220 | amount4 = portfolio.Amount("ETH", 0.0) |
221 | self.assertEqual(amount1, amount1 + amount4) | 221 | self.assertEqual(amount1, amount1 + amount4) |
222 | 222 | ||
223 | self.assertEqual(amount1, amount1 + 0) | ||
224 | |||
223 | def test__radd(self): | 225 | def test__radd(self): |
224 | amount = portfolio.Amount("XVG", "12.9") | 226 | amount = portfolio.Amount("XVG", "12.9") |
225 | 227 | ||
@@ -241,6 +243,13 @@ class AmountTest(WebMockTestCase): | |||
241 | amount4 = portfolio.Amount("ETH", 0.0) | 243 | amount4 = portfolio.Amount("ETH", 0.0) |
242 | self.assertEqual(amount1, amount1 - amount4) | 244 | self.assertEqual(amount1, amount1 - amount4) |
243 | 245 | ||
246 | def test__rsub(self): | ||
247 | amount = portfolio.Amount("ETH", "1.6") | ||
248 | with self.assertRaises(Exception): | ||
249 | 3 - amount | ||
250 | |||
251 | self.assertEqual(portfolio.Amount("ETH", "-1.6"), -amount) | ||
252 | |||
244 | def test__mul(self): | 253 | def test__mul(self): |
245 | amount = portfolio.Amount("XEM", 11) | 254 | amount = portfolio.Amount("XEM", 11) |
246 | 255 | ||