Skip to content

Commit 35f2996

Browse files
malmelooWhyNotHugo
authored andcommitted
Rewrite guess auth test for unsupported status
1 parent 67e1c0d commit 35f2996

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

tests/storage/test_http.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
from tests import normalize_item
88
from vdirsyncer.exceptions import UserError
9-
from vdirsyncer.http import BasicAuthMethod, DigestAuthMethod
9+
from vdirsyncer.http import BasicAuthMethod
10+
from vdirsyncer.http import DigestAuthMethod
1011
from vdirsyncer.storage.http import HttpStorage
1112
from vdirsyncer.storage.http import prepare_auth
1213

@@ -106,20 +107,12 @@ def test_prepare_auth():
106107
assert "unknown authentication method" in str(excinfo.value).lower()
107108

108109

109-
def test_prepare_auth_guess(monkeypatch):
110-
import requests_toolbelt.auth.guess
111-
112-
assert isinstance(
113-
prepare_auth("guess", "user", "pwd"),
114-
requests_toolbelt.auth.guess.GuessAuth,
115-
)
116-
117-
monkeypatch.delattr(requests_toolbelt.auth.guess, "GuessAuth")
118-
110+
def test_prepare_auth_guess():
111+
# guess auth is currently not supported
119112
with pytest.raises(UserError) as excinfo:
120-
prepare_auth("guess", "user", "pwd")
113+
prepare_auth("guess", "usr", "pwd")
121114

122-
assert "requests_toolbelt is too old" in str(excinfo.value).lower()
115+
assert "not supported" in str(excinfo.value).lower()
123116

124117

125118
def test_verify_false_disallowed(aio_connector):

0 commit comments

Comments
 (0)