remove now useless tests
This commit is contained in:
parent
6be0ff67f7
commit
f8fcd48998
@ -238,138 +238,6 @@ class TestHostBlockerUpdate:
|
||||
host_blocker.read_hosts()
|
||||
assert_urls(host_blocker, BLOCKED_HOSTS[3:], whitelisted_hosts=[])
|
||||
|
||||
# def test_remote_text(self, config_stub, basedir, download_stub,
|
||||
# data_tmpdir, tmpdir, win_registry):
|
||||
# """Update with single fakely remote text blocklist.
|
||||
# Ensure urls from hosts in this blocklist get blocked."""
|
||||
# blocklist = create_blocklist(tmpdir)
|
||||
# config_stub.data = {'content':
|
||||
# {'host-block-lists': [blocklist],
|
||||
# 'host-blocking-enabled': True,
|
||||
# 'host-blocking-whitelist': None}}
|
||||
# host_blocker = adblock.HostBlocker()
|
||||
# host_blocker.adblock_update(0)
|
||||
# # Simulate download is finished
|
||||
# # XXX Is it ok to use private attribute hostblocker._in_progress ?
|
||||
# host_blocker._in_progress[0].finished.emit()
|
||||
# host_blocker.read_hosts()
|
||||
# assert_urls(host_blocker, whitelisted_hosts=[])
|
||||
|
||||
# def test_remote_zip_single(self, config_stub, basedir, download_stub,
|
||||
# data_tmpdir, tmpdir, win_registry):
|
||||
# """Update with single fakely remote zip containing one blocklist file.
|
||||
# Ensure urls from hosts in this blocklist get blocked."""
|
||||
# blocklist = create_blocklist(tmpdir)
|
||||
# zip_url = QUrl(create_zipfile([blocklist.path()], tmpdir)[1])
|
||||
# config_stub.data = {'content':
|
||||
# {'host-block-lists': [zip_url],
|
||||
# 'host-blocking-enabled': True,
|
||||
# 'host-blocking-whitelist': None}}
|
||||
# host_blocker = adblock.HostBlocker()
|
||||
# host_blocker.adblock_update(0)
|
||||
# host_blocker._in_progress[0].finished.emit()
|
||||
# host_blocker.read_hosts()
|
||||
# assert_urls(host_blocker, whitelisted_hosts=[])
|
||||
|
||||
# # FIXME adblock.guess_zip_filename should raise FileNotFound Error
|
||||
# # as no files in the zip are called hosts
|
||||
# def test_remote_zip_multi1(self, config_stub, basedir, download_stub,
|
||||
# data_tmpdir, tmpdir, win_registry):
|
||||
# """Update with single fakely remote zip containing two files.
|
||||
# None of them is called hosts, FileNotFoundError should be raised."""
|
||||
# file1 = create_blocklist(tmpdir, name='file1.txt')
|
||||
# file2_hosts = ['testa.com', 'testb.com']
|
||||
# file2 = create_blocklist(tmpdir, file2_hosts, name='file2.txt')
|
||||
# files_to_zip = [file1.path(), file2.path()]
|
||||
# zip_path = create_zipfile(files_to_zip, tmpdir)[1]
|
||||
# zip_url = QUrl(zip_path)
|
||||
# config_stub.data = {'content':
|
||||
# {'host-block-lists': [zip_url],
|
||||
# 'host-blocking-enabled': True,
|
||||
# 'host-blocking-whitelist': None}}
|
||||
# host_blocker = adblock.HostBlocker()
|
||||
# #with pytest.raises(FileNotFoundError):
|
||||
# host_blocker.adblock_update(0)
|
||||
# host_blocker._in_progress[0].finished.emit()
|
||||
# host_blocker.read_hosts()
|
||||
# for str_url in URLS_TO_CHECK:
|
||||
# assert not host_blocker.is_blocked(QUrl(str_url))
|
||||
|
||||
# def test_remote_zip_multi2(self, config_stub, basedir, download_stub,
|
||||
# data_tmpdir, tmpdir, win_registry):
|
||||
# """Update with single fakely remote zip containing two files.
|
||||
# One of them is called hosts and should be used as blocklist.
|
||||
# Ensure urls from hosts in this blocklist get blocked
|
||||
# and the hosts from the other file are not."""
|
||||
# file1 = create_blocklist(tmpdir, name='hosts.txt')
|
||||
# file2_hosts = ['testa.com', 'testb.com']
|
||||
# file2 = create_blocklist(tmpdir, file2_hosts, name='file2.txt')
|
||||
# files_to_zip = [file1.path(), file2.path()]
|
||||
# zip_path = create_zipfile(files_to_zip, tmpdir)[1]
|
||||
# zip_url = QUrl(zip_path)
|
||||
# config_stub.data = {'content':
|
||||
# {'host-block-lists': [zip_url],
|
||||
# 'host-blocking-enabled': True,
|
||||
# 'host-blocking-whitelist': None}}
|
||||
# host_blocker = adblock.HostBlocker()
|
||||
# host_blocker.adblock_update(0)
|
||||
# host_blocker._in_progress[0].finished.emit()
|
||||
# host_blocker.read_hosts()
|
||||
# assert_urls(host_blocker, whitelisted_hosts=[])
|
||||
|
||||
# def test_local_text(self, config_stub, basedir, download_stub,
|
||||
# data_tmpdir, tmpdir, win_registry):
|
||||
# """Update with single local text blocklist.
|
||||
# Ensure urls from hosts in this blocklist get blocked."""
|
||||
# blocklist = create_blocklist(tmpdir)
|
||||
# blocklist.setScheme("file")
|
||||
# config_stub.data = {'content':
|
||||
# {'host-block-lists': [blocklist],
|
||||
# 'host-blocking-enabled': True,
|
||||
# 'host-blocking-whitelist': None}}
|
||||
# host_blocker = adblock.HostBlocker()
|
||||
# host_blocker.adblock_update(0)
|
||||
# host_blocker.read_hosts()
|
||||
# assert_urls(host_blocker, whitelisted_hosts=[])
|
||||
|
||||
# def test_local_zip_single(self, config_stub, basedir, download_stub,
|
||||
# data_tmpdir, tmpdir, win_registry):
|
||||
# """Update with single local zip containing one file.
|
||||
# Ensure urls from hosts in this blocklist get blocked."""
|
||||
# blocklist = create_blocklist(tmpdir)
|
||||
# zip_url = QUrl(create_zipfile([blocklist.path()], tmpdir)[1])
|
||||
# zip_url.setScheme('file')
|
||||
# config_stub.data = {'content':
|
||||
# {'host-block-lists': [zip_url],
|
||||
# 'host-blocking-enabled': True,
|
||||
# 'host-blocking-whitelist': None}}
|
||||
# host_blocker = adblock.HostBlocker()
|
||||
# host_blocker.adblock_update(0)
|
||||
# host_blocker.read_hosts()
|
||||
# assert_urls(host_blocker, whitelisted_hosts=[])
|
||||
|
||||
# def test_local_zip_multi(self, config_stub, basedir, download_stub,
|
||||
# data_tmpdir, tmpdir, win_registry):
|
||||
# """Update with single local zip containing two files.
|
||||
# One of them is called hosts and should be used as blocklist.
|
||||
# Ensure urls from hosts in this blocklist get blocked
|
||||
# and the hosts from the other file are not."""
|
||||
# file1 = create_blocklist(tmpdir, name='hosts.txt')
|
||||
# file2_hosts = ['testa.com', 'testb.com']
|
||||
# file2 = create_blocklist(tmpdir, file2_hosts, name='file2.txt')
|
||||
# files_to_zip = [file1.path(), file2.path()]
|
||||
# zip_path = create_zipfile(files_to_zip, tmpdir)[1]
|
||||
# zip_url = QUrl(zip_path)
|
||||
# zip_url.setScheme('file')
|
||||
# config_stub.data = {'content':
|
||||
# {'host-block-lists': [zip_url],
|
||||
# 'host-blocking-enabled': True,
|
||||
# 'host-blocking-whitelist': None}}
|
||||
# host_blocker = adblock.HostBlocker()
|
||||
# host_blocker.adblock_update(0)
|
||||
# host_blocker.read_hosts()
|
||||
# assert_urls(host_blocker, whitelisted_hosts=[])
|
||||
|
||||
class TestHostBlockerIsBlocked:
|
||||
|
||||
"""Tests for function adblock_update of class HostBlocker."""
|
||||
|
Loading…
Reference in New Issue
Block a user