Skip to content

Commit db518c1

Browse files
committed
imp: tests + nginx logs
1 parent 439dad6 commit db518c1

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

templates/nginx.conf.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ events {
1212
pid /usr/local/etc/adblock2privoxy/nginx-adblock2privoxy.pid;
1313

1414
# error_log /opt/local/var/log/nginx/error-adblock2privoxy.log warn;
15-
error_log /dev/null;
15+
error_log stderr warn;
1616

1717
http {
1818
# access_log /opt/local/var/log/nginx/access-adblock2privoxy.log;
19-
access_log /dev/null;
19+
access_log /dev/stdout;
2020

2121
# Increase client_max_body_size to handle larger requests, uncommented for clarity
2222
client_max_body_size 64M;

tests/test_privoxy.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ def test_http_adblock_blackhole(self, docker_privoxy, env_info):
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")
56+
resp = requests.get(
57+
f"http://{env_info['ip']}/notexists/ab2p.common.css", allow_redirects=True
58+
)
5759
assert resp.status_code == 200
5860
mime_type = resp.headers.get("Content-Type")
5961
assert mime_type == "text/html"
@@ -68,14 +70,6 @@ def test_https_adblock_blackhole(self, docker_privoxy, env_info):
6870
mime_type = resp.headers.get("Content-Type")
6971
assert mime_type == "text/html"
7072
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
7973

8074
def test_http_adblock_css_filters(self, docker_privoxy, env_info):
8175
resp = requests.get(f"http://{env_info['ip']}/ab2p.common.css")

0 commit comments

Comments
 (0)