get_cryptoportfolio.assert_called_once_with()
retrieve_cryptoportfolio.assert_called_once_with()
+ retrieve_cryptoportfolio.reset_mock()
+ get_cryptoportfolio.reset_mock()
+
+ with self.subTest("absent liquidities"):
+ market.Portfolio.last_date = store.LockedVar("2018-03-15")
+ self.assertIsNone(market.Portfolio.repartition())
+
+ with self.subTest("no liquidities"):
+ market.Portfolio.liquidities = store.LockedVar({})
+ market.Portfolio.last_date = store.LockedVar("2018-03-08")
+ self.assertIsNone(market.Portfolio.repartition())
+
@mock.patch.object(market.time, "sleep")
@mock.patch.object(market.Portfolio, "get_cryptoportfolio")
def test_wait_for_recent(self, get_cryptoportfolio, sleep):