@@ -13,7 +13,7 @@ def test_root_incorrect_auth():
13
13
session = requests .Session ()
14
14
session .auth = ('nonexistant' , 'incorrect' )
15
15
response = session .get (BASE_URL )
16
- assert response .status_code == 403
16
+ assert response .status_code == 401
17
17
assert 'scrapyd-k8s' not in response .text
18
18
19
19
def test_root_correct_auth ():
@@ -37,14 +37,14 @@ def test_daemonstatus_no_auth():
37
37
def test_daemonstatus_incorrect_auth ():
38
38
session = requests .Session ()
39
39
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
42
42
assert 'ok' not in response .text
43
43
44
44
def test_daemonstatus_correct_auth ():
45
45
session = requests .Session ()
46
46
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' )
48
48
assert response .status_code == 200
49
49
assert response .headers ['Content-Type' ] == 'application/json'
50
50
assert response .json ()['status' ] == 'ok'
0 commit comments