X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Ftest_store.py;h=3097f6d5d49d30f97bea413c3138cac6c21683ce;hb=5f721612111af5c56b5757cb2f21da5f2fa388bf;hp=1a722b514e8057fb8472f10e0426047c9664f305;hpb=3d6f74ee1a8b061e4b274dad70125ab6388f4d83;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FTrader.git diff --git a/tests/test_store.py b/tests/test_store.py index 1a722b5..3097f6d 100644 --- a/tests/test_store.py +++ b/tests/test_store.py @@ -1537,6 +1537,18 @@ class PortfolioTest(WebMockTestCase): 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):