def test_cache_config_disable_private_browsing(config_stub, tmpdir):
 config_stub.data = {'storage': {'cache-size': 1024}, 'general': {'private-browsing': True}}
 url = 'http://qutebrowser.org'
 metadata = QNetworkCacheMetaData()
 metadata.setUrl(QUrl(url))
 assert metadata.isValid()
 disk_cache = cache.DiskCache(str(tmpdir))
 assert (disk_cache.prepare(metadata) is None)
 config_stub.set('general', 'private-browsing', False)
 content = 'cute'
 preload_cache(disk_cache, url, content)
 assert (disk_cache.data(QUrl(url)).readAll() == content)

def test_cache_config_disable_private_browsing ( config_stub , tmpdir ) : config_stub . data = { 'storage' : { 'cache-size' : 1024 } , 'general' : { 'private-browsing' : True } } url = 'http://qutebrowser.org' metadata = QNetworkCacheMetaData ( ) metadata . setUrl ( QUrl ( url ) ) assert metadata . isValid ( ) disk_cache = cache . DiskCache ( str ( tmpdir ) ) assert ( disk_cache . prepare ( metadata ) is None ) config_stub . set ( 'general' , 'private-browsing' , False ) content = 'cute' preload_cache ( disk_cache , url , content ) assert ( disk_cache . data ( QUrl ( url ) ) . readAll ( ) == content )
change private-browsing config to false and emit signal .