Changeset - 3b5a563ef64b
[Not reviewed]
0 2 0
Brett Smith - 7 years ago 2017-05-17 16:56:19
brettcsmith@brettcsmith.org
historical: Write results to cache when appropriate.
2 files changed with 5 insertions and 0 deletions:
0 comments (0 inline, 0 general)
oxrlib/commands/historical.py
Show inline comments
...
 
@@ -13,4 +13,6 @@ def run(config, stdout, stderr):
 
    with loaders.historical(config.args.date, config.args.base) as rate_json:
 
        rate = oxrrate.Rate.from_json_file(rate_json)
 
    if loaders.should_cache():
 
        config.cache.save_rate(rate)
 
    if not config.args.from_currency:
 
        for from_curr in sorted(rate.rates):
tests/test_historical.py
Show inline comments
...
 
@@ -20,4 +20,7 @@ class FakeResponder:
 
        return self._respond
 

	
 
    def should_cache(self):
 
        return False
 

	
 

	
 
class FakeConfig:
0 comments (0 inline, 0 general)