Skip to content

Commit 439dad6

Browse files
committed
imp: tests + docs
1 parent 18fee93 commit 439dad6

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ This image downloads the 'trustedCAs' file from curl.se and also generates the c
1818

1919
- The default configuration is intended for personal use only
2020
- If you use ab2p rules, make sure that the routing to the service is configured correctly. Otherwise, you will experience significant loading delays. You can see a basic example in ```docs/traefik.md```.
21+
- Also check that the adblock2privoxy URL is not being blocked by the proxy itself
2122

2223
### Default Ports
2324

tests/test_privoxy.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,19 @@ def test_https_no_adblock_filters(self):
4747
except ConnectionError:
4848
pass # 99% blocked by external software
4949

50-
def test_http_adblock_blackhole(self, docker_privoxy, make_request, env_info):
50+
def test_http_adblock_blackhole(self, docker_privoxy, env_info):
5151
resp = requests.get(f"http://{env_info['ip']}/@blackhole")
5252
assert resp.status_code == 200
5353
mime_type = resp.headers.get("Content-Type")
5454
assert mime_type == "text/html"
5555
assert "adblock2privoxy" in resp.text
56+
resp = requests.get(f"http://{env_info['ip']}/notexists/ab2p.common.css")
57+
assert resp.status_code == 200
58+
mime_type = resp.headers.get("Content-Type")
59+
assert mime_type == "text/html"
60+
assert "adblock2privoxy" in resp.text
5661

57-
def test_https_adblock_blackhole(self, docker_privoxy, make_request, env_info):
62+
def test_https_adblock_blackhole(self, docker_privoxy, env_info):
5863
resp = requests.get(
5964
f"https://{env_info['ip']}/@blackhole",
6065
verify="./tests/privoxy-ca-bundle.crt",
@@ -63,14 +68,22 @@ def test_https_adblock_blackhole(self, docker_privoxy, make_request, env_info):
6368
mime_type = resp.headers.get("Content-Type")
6469
assert mime_type == "text/html"
6570
assert "adblock2privoxy" in resp.text
71+
resp = requests.get(
72+
f"https://{env_info['ip']}/notexists/ab2p.common.css",
73+
verify="./tests/privoxy-ca-bundle.crt",
74+
)
75+
assert resp.status_code == 200
76+
mime_type = resp.headers.get("Content-Type")
77+
assert mime_type == "text/html"
78+
assert "adblock2privoxy" in resp.text
6679

67-
def test_http_adblock_css_filters(self, docker_privoxy, make_request, env_info):
80+
def test_http_adblock_css_filters(self, docker_privoxy, env_info):
6881
resp = requests.get(f"http://{env_info['ip']}/ab2p.common.css")
6982
assert resp.status_code == 200
7083
mime_type = resp.headers.get("Content-Type")
7184
assert mime_type == "text/css"
7285

73-
def test_https_adblock_css_filters(self, docker_privoxy, make_request, env_info):
86+
def test_https_adblock_css_filters(self, docker_privoxy, env_info):
7487
resp = requests.get(
7588
f"https://{env_info['ip']}/ab2p.common.css",
7689
verify="./tests/privoxy-ca-bundle.crt",

0 commit comments

Comments
 (0)