def test_disabled_blocking_update(basedir, config_stub, download_stub, data_tmpdir, tmpdir, win_registry, caplog):
 config_stub.data = {'content': {'host-block-lists': generic_blocklists(tmpdir), 'host-blocking-enabled': False}}
 host_blocker = adblock.HostBlocker()
 host_blocker.adblock_update()
 while host_blocker._in_progress:
  current_download = host_blocker._in_progress[0]
  with caplog.at_level(logging.ERROR):
   current_download.finished.emit()
 host_blocker.read_hosts()
 for str_url in URLS_TO_CHECK:
  assert (not host_blocker.is_blocked(QUrl(str_url)))

def test_disabled_blocking_update ( basedir , config_stub , download_stub , data_tmpdir , tmpdir , win_registry , caplog ) : config_stub . data = { 'content' : { 'host-block-lists' : generic_blocklists ( tmpdir ) , 'host-blocking-enabled' : False } } host_blocker = adblock . HostBlocker ( ) host_blocker . adblock_update ( ) while host_blocker . _in_progress : current_download = host_blocker . _in_progress [ 0 ] with caplog . at_level ( logging . ERROR ) : current_download . finished . emit ( ) host_blocker . read_hosts ( ) for str_url in URLS_TO_CHECK : assert ( not host_blocker . is_blocked ( QUrl ( str_url ) ) )
ensure no url is blocked when host blocking is disabled .