From b94f7c7681ef5cd85f78a0e1c6c5b38857187d40 Mon Sep 17 00:00:00 2001 From: Lamar Pavel Date: Sat, 31 Oct 2015 18:49:58 +0100 Subject: [PATCH] Add test for metaData() with cache deactivated --- tests/unit/browser/test_cache.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/unit/browser/test_cache.py b/tests/unit/browser/test_cache.py index 6fbf91919..bc669d637 100644 --- a/tests/unit/browser/test_cache.py +++ b/tests/unit/browser/test_cache.py @@ -213,6 +213,18 @@ def test_cache_metadata(config_stub, tmpdir): assert disk_cache.metaData(QUrl(url)) == metadata +def test_cache_deactivated_metadata(config_stub, tmpdir): + """Test querying metaData() on not activated cache.""" + config_stub.data = { + 'storage': {'cache-size': 1024}, + 'general': {'private-browsing': True} + } + url = 'http://qutebrowser.org' + + disk_cache = cache.DiskCache(str(tmpdir)) + assert disk_cache.metaData(QUrl(url)) == QNetworkCacheMetaData() + + def test_cache_update_metadata(config_stub, tmpdir): """Test updating the meta data for an existing cache entry.""" config_stub.data = {