summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAnder Punnar <ander@kvlt.ee>2021-04-09 22:57:41 +0300
committerAnder Punnar <ander@kvlt.ee>2021-04-09 22:57:41 +0300
commit26b84e1c9502d4178c0d0dbcf07a8f8eca8606cb (patch)
treebb39ccf5b3d3d48795540be7196fa3a34d101553 /tests
parent569b7c1ed2400ef20f2492076574f6b53d07c07e (diff)
downloadqutebrowser-26b84e1c9502d4178c0d0dbcf07a8f8eca8606cb.tar.gz
qutebrowser-26b84e1c9502d4178c0d0dbcf07a8f8eca8606cb.zip
add subdomain blocking test
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/components/test_hostblock.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/unit/components/test_hostblock.py b/tests/unit/components/test_hostblock.py
index 9344e1160..00a7a5f8f 100644
--- a/tests/unit/components/test_hostblock.py
+++ b/tests/unit/components/test_hostblock.py
@@ -563,3 +563,11 @@ def test_adblock_benchmark(data_tmpdir, benchmark, host_blocker_factory):
assert blocker._blocked_hosts
benchmark(lambda: blocker._is_blocked(url))
+
+
+def test_subdomain_blocking(config_stub, host_blocker_factory):
+ config_stub.val.content.blocking.method = "hosts"
+ config_stub.val.content.blocking.hosts.lists = None
+ host_blocker = host_blocker_factory()
+ host_blocker._blocked_hosts.add("example.com")
+ assert host_blocker._is_blocked(QUrl("https://subdomain.example.com"))