def test_cache_insert_data(config_stub, tmpdir):
 config_stub.data = {'storage': {'cache-size': 1024}, 'general': {'private-browsing': False}}
 url = 'http://qutebrowser.org'
 content = 'foobar'
 disk_cache = cache.DiskCache(str(tmpdir))
 assert (disk_cache.cacheSize() == 0)
 preload_cache(disk_cache, url, content)
 assert (disk_cache.cacheSize() != 0)
 assert (disk_cache.data(QUrl(url)).readAll() == content)

def test_cache_insert_data ( config_stub , tmpdir ) : config_stub . data = { 'storage' : { 'cache-size' : 1024 } , 'general' : { 'private-browsing' : False } } url = 'http://qutebrowser.org' content = 'foobar' disk_cache = cache . DiskCache ( str ( tmpdir ) ) assert ( disk_cache . cacheSize ( ) == 0 ) preload_cache ( disk_cache , url , content ) assert ( disk_cache . cacheSize ( ) != 0 ) assert ( disk_cache . data ( QUrl ( url ) ) . readAll ( ) == content )
test if entries inserted into the cache are actually there .