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:
parent
3c2bc670ff
commit
35762955cf
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user