]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Trader.git/commitdiff
Add latest date to redis
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Sat, 21 Apr 2018 08:44:16 +0000 (10:44 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Sat, 21 Apr 2018 08:44:16 +0000 (10:44 +0200)
market.py
tests/test_market.py

index ce0c48cddb67597845e3e979eb8b373300037866..ce418415ad30e30ab6c9e556ee1a3d2b1c4cd94f 100644 (file)
--- 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))
 
index e3482b8ad328c2bf917c73b5d77e6731bec6521d..e0cf70aa4beda24db29454ad861bb29726c8b245 100644 (file)
@@ -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()