From: Ismaƫl Bouya Date: Sat, 21 Apr 2018 08:44:16 +0000 (+0200) Subject: Add latest date to redis X-Git-Tag: v1.3.1^2 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=17fd3f752d5e37df906abddf1f13fd7ad1de6c00;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FTrader.git Add latest date to redis --- diff --git a/market.py b/market.py index ce0c48c..ce41841 100644 --- a/market.py +++ b/market.py @@ -85,6 +85,8 @@ class Market: conn.set(key, log, ex=31*24*60*60) key = "/cryptoportfolio/{}/latest/{}".format(self.market_id, type_) conn.set(key, log) + key = "/cryptoportfolio/{}/latest/date".format(self.market_id) + conn.set(key, date.isoformat()) except Exception as e: print("impossible to store report to redis: {}; {}".format(e.__class__.__name__, e)) diff --git a/tests/test_market.py b/tests/test_market.py index e3482b8..e0cf70a 100644 --- a/tests/test_market.py +++ b/tests/test_market.py @@ -550,6 +550,7 @@ class MarketTest(WebMockTestCase): mock.call.set("/cryptoportfolio/1/latest/type1", "payload1"), mock.call.set("/cryptoportfolio/1/2018-03-24T00:00:00/type2", "payload2", ex=31*24*60*60), mock.call.set("/cryptoportfolio/1/latest/type2", "payload2"), + mock.call.set("/cryptoportfolio/1/latest/date", "2018-03-24T00:00:00"), ]) connect_mock.reset_mock()