From 35762955cff1c136734dcbc36465565b451319d6 Mon Sep 17 00:00:00 2001 From: Lamar Pavel Date: Sat, 31 Oct 2015 16:57:00 +0100 Subject: [PATCH] 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. --- tests/unit/browser/test_cache.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/unit/browser/test_cache.py b/tests/unit/browser/test_cache.py index 05ef3db95..d35831b49 100644 --- a/tests/unit/browser/test_cache.py +++ b/tests/unit/browser/test_cache.py @@ -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.""" + config_stub.data = { + 'storage': {'cache-size': 1024}, + 'general': {'private-browsing': False} + } url = 'http://qutebrowser.org' - disk_cache = QNetworkDiskCache() - disk_cache.setCacheDirectory(str(tmpdir)) + disk_cache = cache.DiskCache(str(tmpdir)) preload_cache(disk_cache, url) assert disk_cache.cacheSize() > 0