aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-01-26 00:07:47 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-01-26 00:07:47 +0100
commit66c8b3dd07f4e45be2242d06f8f357adefeb2a4c (patch)
treed8fcc5682d2ff6d40f341fb3a2b263c1f7d02952
parent77f8a3789e293ece45946abd7ea3acffdf6add82 (diff)
downloadTrader-66c8b3dd07f4e45be2242d06f8f357adefeb2a4c.tar.gz
Trader-66c8b3dd07f4e45be2242d06f8f357adefeb2a4c.tar.zst
Trader-66c8b3dd07f4e45be2242d06f8f357adefeb2a4c.zip
Add test for Trade
-rw-r--r--test.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/test.py b/test.py
index daf5fe4..b747617 100644
--- a/test.py
+++ b/test.py
@@ -489,7 +489,21 @@ class TradeTest(unittest.TestCase):
489 489
490 @unittest.skip("TODO") 490 @unittest.skip("TODO")
491 def test_values_assertion(self): 491 def test_values_assertion(self):
492 pass 492 value_from = Amount("BTC", "1.0")
493 value_from.linked_to = Amount("ETH", "10.0")
494 value_to = Amount("BTC", "1.0")
495 trade = portfolioTrade(value_from, value_to, "ETH")
496 self.assertEqual("BTC", trade.base_currency)
497 self.assertEqual("ETH", trade.currency)
498
499 with self.assertRaises(AssertionError):
500 portfolio.Trade(value_from, value_to, "ETC")
501 with self.assertRaises(AssertionError):
502 value_from.linked_to = None
503 portfolio.Trade(value_from, value_to, "ETH")
504 with self.assertRaises(AssertionError):
505 value_from.currency = "ETH"
506 portfolio.Trade(value_from, value_to, "ETH")
493 507
494 @unittest.skip("TODO") 508 @unittest.skip("TODO")
495 def test_fetch_fees(self): 509 def test_fetch_fees(self):