Test if cleared cache is actually empty

This commit is contained in:
Lamar Pavel 2015-10-21 14:33:45 +02:00
parent aa62a547d5
commit 0b78fb65c9

View File

@ -53,3 +53,14 @@ def test_cache_deactivated_no_cachedir(config_stub):
}
disk_cache = cache.DiskCache("")
assert(0 == disk_cache.cacheSize())
def test_clear_cache_activated(config_stub, tmpdir):
"""Test if cache empty after clearing it."""
config_stub.data = {
'storage': {'cache-size': 1024},
'general': {'private-browsing': False}
}
disk_cache = cache.DiskCache(str(tmpdir))
disk_cache.clear()
assert(0 == disk_cache.cacheSize())