1
0
mirror of https://github.com/thib8956/nginx-proxy synced 2025-02-24 09:48:14 +00:00

ci: remove InsecureRequestWarning from urllib3

This commit is contained in:
Nicolas Duchon 2021-08-02 18:09:34 +02:00
parent caab609f5d
commit 795e0acda7
No known key found for this signature in database
GPG Key ID: EA3151C66A4D79E7
2 changed files with 6 additions and 2 deletions

View File

@ -1,3 +1,6 @@
import pytest
def test_arbitrary_headers_are_passed_on(docker_compose, nginxproxy): def test_arbitrary_headers_are_passed_on(docker_compose, nginxproxy):
r = nginxproxy.get("https://web.nginx-proxy.tld/headers", headers={'Foo': 'Bar'}) r = nginxproxy.get("https://web.nginx-proxy.tld/headers", headers={'Foo': 'Bar'})
assert r.status_code == 200 assert r.status_code == 200
@ -78,6 +81,7 @@ def test_httpoxy_safe(docker_compose, nginxproxy):
assert "Proxy:" not in r.text assert "Proxy:" not in r.text
@pytest.mark.filterwarnings('ignore::urllib3.exceptions.InsecureRequestWarning')
def test_no_host_server_tokens_off(docker_compose, nginxproxy): def test_no_host_server_tokens_off(docker_compose, nginxproxy):
ip = nginxproxy.get_ip() ip = nginxproxy.get_ip()
r = nginxproxy.get(f"https://{ip}/headers", verify=False) r = nginxproxy.get(f"https://{ip}/headers", verify=False)
@ -86,7 +90,7 @@ def test_no_host_server_tokens_off(docker_compose, nginxproxy):
def test_server_tokens_on(docker_compose, nginxproxy): def test_server_tokens_on(docker_compose, nginxproxy):
r = nginxproxy.get("https://web.nginx-proxy.tld/headers", verify=False) r = nginxproxy.get("https://web.nginx-proxy.tld/headers")
assert r.status_code == 200 assert r.status_code == 200
assert "Host: web.nginx-proxy.tld" in r.text assert "Host: web.nginx-proxy.tld" in r.text
assert r.headers["Server"].startswith("nginx/") assert r.headers["Server"].startswith("nginx/")

View File

@ -23,7 +23,7 @@ def test_https_get_served(docker_compose, nginxproxy, subdomain):
assert r.status_code == 200 assert r.status_code == 200
assert f"answer from port 8{subdomain}\n" == r.text assert f"answer from port 8{subdomain}\n" == r.text
@pytest.mark.filterwarnings('ignore::urllib3.exceptions.InsecureRequestWarning')
def test_web3_https_is_500_and_SSL_validation_fails(docker_compose, nginxproxy): def test_web3_https_is_500_and_SSL_validation_fails(docker_compose, nginxproxy):
with pytest.raises( (CertificateError, SSLError) ) as excinfo: with pytest.raises( (CertificateError, SSLError) ) as excinfo:
nginxproxy.get("https://3.web.nginx-proxy.tld/port") nginxproxy.get("https://3.web.nginx-proxy.tld/port")