mirror of
				https://github.com/thib8956/nginx-proxy
				synced 2025-11-04 02:59:20 +00:00 
			
		
		
		
	tests: fix tests & test compose file
This commit is contained in:
		@@ -4,31 +4,31 @@ import pytest
 | 
				
			|||||||
# Permanent Redirects
 | 
					# Permanent Redirects
 | 
				
			||||||
# https://github.com/nginx-proxy/nginx-proxy/pull/1737
 | 
					# https://github.com/nginx-proxy/nginx-proxy/pull/1737
 | 
				
			||||||
def test_web1_GET_301(docker_compose, nginxproxy):
 | 
					def test_web1_GET_301(docker_compose, nginxproxy):
 | 
				
			||||||
    r = nginxproxy.get('http://web1.nginx-proxy.tld', allow_redirects=False)
 | 
					    r = nginxproxy.get('http://nginx-proxy.tld', allow_redirects=False)
 | 
				
			||||||
    assert r.status_code == 301
 | 
					    assert r.status_code == 301
 | 
				
			||||||
    assert r.headers['Location'] == 'https://web1.nginx-proxy.tld/'
 | 
					    assert r.headers['Location'] == 'https://nginx-proxy.tld/'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_web1_POST_308(docker_compose, nginxproxy):
 | 
					def test_web1_POST_308(docker_compose, nginxproxy):
 | 
				
			||||||
    r = nginxproxy.post('http://web1.nginx-proxy.tld', allow_redirects=False)
 | 
					    r = nginxproxy.post('http://nginx-proxy.tld', allow_redirects=False)
 | 
				
			||||||
    assert r.status_code == 308
 | 
					    assert r.status_code == 308
 | 
				
			||||||
    assert r.headers['Location'] == 'https://web1.nginx-proxy.tld/'
 | 
					    assert r.headers['Location'] == 'https://nginx-proxy.tld/'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_web1_PUT_308(docker_compose, nginxproxy):
 | 
					def test_web1_PUT_308(docker_compose, nginxproxy):
 | 
				
			||||||
    r = nginxproxy.put('http://web1.nginx-proxy.tld', allow_redirects=False)
 | 
					    r = nginxproxy.put('http://nginx-proxy.tld', allow_redirects=False)
 | 
				
			||||||
    assert r.status_code == 308
 | 
					    assert r.status_code == 308
 | 
				
			||||||
    assert r.headers['Location'] == 'https://web1.nginx-proxy.tld/'
 | 
					    assert r.headers['Location'] == 'https://nginx-proxy.tld/'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_web1_HEAD_308(docker_compose, nginxproxy):
 | 
					def test_web1_HEAD_308(docker_compose, nginxproxy):
 | 
				
			||||||
    r = nginxproxy.head('http://web1.nginx-proxy.tld', allow_redirects=False)
 | 
					    r = nginxproxy.head('http://nginx-proxy.tld', allow_redirects=False)
 | 
				
			||||||
    assert r.status_code == 308
 | 
					    assert r.status_code == 308
 | 
				
			||||||
    assert r.headers['Location'] == 'https://web1.nginx-proxy.tld/'
 | 
					    assert r.headers['Location'] == 'https://nginx-proxy.tld/'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_web1_DELETE_308(docker_compose, nginxproxy):
 | 
					def test_web1_DELETE_308(docker_compose, nginxproxy):
 | 
				
			||||||
    r = nginxproxy.delete('http://web1.nginx-proxy.tld', allow_redirects=False)
 | 
					    r = nginxproxy.delete('http://nginx-proxy.tld', allow_redirects=False)
 | 
				
			||||||
    assert r.status_code == 308
 | 
					    assert r.status_code == 308
 | 
				
			||||||
    assert r.headers['Location'] == 'https://web1.nginx-proxy.tld/'
 | 
					    assert r.headers['Location'] == 'https://nginx-proxy.tld/'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_web1_OPTIONS_308(docker_compose, nginxproxy):
 | 
					def test_web1_OPTIONS_308(docker_compose, nginxproxy):
 | 
				
			||||||
    r = nginxproxy.options('http://web1.nginx-proxy.tld', allow_redirects=False)
 | 
					    r = nginxproxy.options('http://nginx-proxy.tld', allow_redirects=False)
 | 
				
			||||||
    assert r.status_code == 308
 | 
					    assert r.status_code == 308
 | 
				
			||||||
    assert r.headers['Location'] == 'https://web1.nginx-proxy.tld/'
 | 
					    assert r.headers['Location'] == 'https://nginx-proxy.tld/'
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,14 +1,14 @@
 | 
				
			|||||||
web1:
 | 
					services:
 | 
				
			||||||
  image: web
 | 
					  web1:
 | 
				
			||||||
  expose:
 | 
					    image: web
 | 
				
			||||||
    - "81"
 | 
					    expose:
 | 
				
			||||||
  environment:
 | 
					      - "81"
 | 
				
			||||||
    WEB_PORTS: "81"
 | 
					    environment:
 | 
				
			||||||
    VIRTUAL_HOST: "web1.nginx-proxy.tld"
 | 
					      WEB_PORTS: "81"
 | 
				
			||||||
 | 
					      VIRTUAL_HOST: "nginx-proxy.tld"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sut:
 | 
					  sut:
 | 
				
			||||||
  image: nginxproxy/nginx-proxy:test
 | 
					    image: nginxproxy/nginx-proxy:test
 | 
				
			||||||
  volumes:
 | 
					    volumes:
 | 
				
			||||||
    - /var/run/docker.sock:/tmp/docker.sock:ro
 | 
					      - /var/run/docker.sock:/tmp/docker.sock:ro
 | 
				
			||||||
    - ../lib/ssl/dhparam.pem:/etc/nginx/dhparam/dhparam.pem:ro
 | 
					      - ./certs:/etc/nginx/certs:ro
 | 
				
			||||||
    - ./certs:/etc/nginx/certs:ro
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user