ticker=asset_ticker,
rate=rate)
else:
- raise Exception("This asset is not available in the chosen market")
+ return Amount(other_currency, 0, linked_to=self, ticker=None, rate=0)
def as_json(self):
return {
with self.subTest(desc="no ticker for currency"):
self.m.get_ticker.return_value = None
- self.assertRaises(Exception, amount.in_currency, "ETH", self.m)
+ self.assertEqual(portfolio.Amount("ETH", 0), amount.in_currency("ETH", self.m))
with self.subTest(desc="nominal case"):
self.m.get_ticker.return_value = {