tests: Rename TestCacheFile to avoid pytest warnings.
This commit is contained in:
parent
348b82e087
commit
84bc0c7e84
1 changed files with 3 additions and 3 deletions
|
@ -11,7 +11,7 @@ import oxrlib.errors
|
|||
CACHE_PATH = relpath('writecache')
|
||||
HISTORICAL_PATTERN = '{date}_{base}_cache.json'
|
||||
|
||||
class TestCacheFile(oxrlib.cache.WriteCacheFile):
|
||||
class FakeCacheFile(oxrlib.cache.WriteCacheFile):
|
||||
def __init__(self, path, *args, **kwargs):
|
||||
self.path = path
|
||||
assert args[0].startswith('w')
|
||||
|
@ -31,7 +31,7 @@ class FakeRate:
|
|||
|
||||
@pytest.fixture
|
||||
def dummycache():
|
||||
cache = oxrlib.cache.CacheWriter(CACHE_PATH, file_class=TestCacheFile)
|
||||
cache = oxrlib.cache.CacheWriter(CACHE_PATH, file_class=FakeCacheFile)
|
||||
cache.setup(historical=HISTORICAL_PATTERN)
|
||||
return cache
|
||||
|
||||
|
@ -44,4 +44,4 @@ def test_cache_success(dummycache, any_date):
|
|||
def test_save_rate(dummycache, any_date):
|
||||
rate = FakeRate(any_date, 'USD')
|
||||
dummycache.save_rate(rate)
|
||||
assert TestCacheFile.last_file.last_value == json.dumps(rate.serialize())
|
||||
assert FakeCacheFile.last_file.last_value == json.dumps(rate.serialize())
|
||||
|
|
Loading…
Reference in a new issue