Fix test_cache_remove_data

The test was not using qutebrowsers DiskCache class at all but Qts
QNetworkDiskCache. As a result the code paths of DiskCache.remove()
were never visited.
This commit is contained in:
Lamar Pavel 2015-10-31 16:57:00 +01:00
parent 3c2bc670ff
commit 35762955cf

View File

@ -152,11 +152,14 @@ def test_cache_deactivated_insert_data(config_stub, tmpdir):
def test_cache_remove_data(tmpdir): def test_cache_remove_data(config_stub, tmpdir):
"""Test if a previously inserted entry can be removed from the cache.""" """Test if a previously inserted entry can be removed from the cache."""
config_stub.data = {
'storage': {'cache-size': 1024},
'general': {'private-browsing': False}
}
url = 'http://qutebrowser.org' url = 'http://qutebrowser.org'
disk_cache = QNetworkDiskCache() disk_cache = cache.DiskCache(str(tmpdir))
disk_cache.setCacheDirectory(str(tmpdir))
preload_cache(disk_cache, url) preload_cache(disk_cache, url)
assert disk_cache.cacheSize() > 0 assert disk_cache.cacheSize() > 0