def test_cache_deactivated_private_browsing(config_stub, tmpdir):
 config_stub.data = {'storage': {'cache-size': 1024}, 'general': {'private-browsing': True}}
 disk_cache = cache.DiskCache(str(tmpdir))
 metadata = QNetworkCacheMetaData()
 metadata.setUrl(QUrl('http://www.example.com/'))
 assert metadata.isValid()
 assert (disk_cache.prepare(metadata) is None)

def test_cache_deactivated_private_browsing ( config_stub , tmpdir ) : config_stub . data = { 'storage' : { 'cache-size' : 1024 } , 'general' : { 'private-browsing' : True } } disk_cache = cache . DiskCache ( str ( tmpdir ) ) metadata = QNetworkCacheMetaData ( ) metadata . setUrl ( QUrl ( 'http://www.example.com/' ) ) assert metadata . isValid ( ) assert ( disk_cache . prepare ( metadata ) is None )
test if cache is deactivated in private-browsing mode .