Add test for alternate path of DiskCache.clear()

This commit is contained in:
Lamar Pavel 2015-10-31 16:31:47 +01:00
parent e1446c3448
commit 3c2bc670ff

View File

@ -180,6 +180,16 @@ def test_cache_clear_activated(config_stub, tmpdir):
assert disk_cache.cacheSize() == 0 assert disk_cache.cacheSize() == 0
def test_cache_clear_deactivated(config_stub, tmpdir):
"""Test method clear() on deactivated cache."""
config_stub.data = {
'storage': {'cache-size': 1024},
'general': {'private-browsing': True}
}
disk_cache = cache.DiskCache(str(tmpdir))
assert disk_cache.clear() is None
def test_cache_metadata(tmpdir): def test_cache_metadata(tmpdir):
"""Ensure that DiskCache.metaData() returns exactly what was inserted.""" """Ensure that DiskCache.metaData() returns exactly what was inserted."""
url = 'http://qutebrowser.org' url = 'http://qutebrowser.org'