Skip to content

Commit d672142

Browse files
committed
Fix auth integration test
1 parent b760a8e commit d672142

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scrapyd_k8s/tests/integration/test_auth.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def test_root_incorrect_auth():
1313
session = requests.Session()
1414
session.auth = ('nonexistant', 'incorrect')
1515
response = session.get(BASE_URL)
16-
assert response.status_code == 403
16+
assert response.status_code == 401
1717
assert 'scrapyd-k8s' not in response.text
1818

1919
def test_root_correct_auth():
@@ -37,14 +37,14 @@ def test_daemonstatus_no_auth():
3737
def test_daemonstatus_incorrect_auth():
3838
session = requests.Session()
3939
session.auth = ('nonexistant', 'incorrect')
40-
response = requests.get(BASE_URL + '/daemonstatus.json')
41-
assert response.status_code == 403
40+
response = session.get(BASE_URL + '/daemonstatus.json')
41+
assert response.status_code == 401
4242
assert 'ok' not in response.text
4343

4444
def test_daemonstatus_correct_auth():
4545
session = requests.Session()
4646
session.auth = ('foo', 'secret') # needs to match test_auth.conf
47-
response = requests.get(BASE_URL + '/daemonstatus.json')
47+
response = session.get(BASE_URL + '/daemonstatus.json')
4848
assert response.status_code == 200
4949
assert response.headers['Content-Type'] == 'application/json'
5050
assert response.json()['status'] == 'ok'

0 commit comments

Comments
 (0)