Skip to content

Commit c4bda24

Browse files
author
Fabien Coelho
committed
improve test assertion
1 parent 82a3bfb commit c4bda24

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/test.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,17 @@ def test_admin(api):
123123

124124
def test_errors(api):
125125
# these schemes are not allowed
126-
for scheme in ("header", "cookie", "fake", "tparam", "unexpected"):
126+
for scheme in ("header", "cookie", "fake", "tparam"):
127127
try:
128128
api.get("/login", login="calvin", auth=scheme)
129129
pytest.fail("must raise an exception") # pragma: no cover
130130
except ft.AuthError as e:
131-
assert True, "expected error"
131+
assert "auth is not allowed" in str(e)
132+
try:
133+
api.get("/login", login="calvin", auth="foobla")
134+
pytest.fail("must raise an exception") # pragma: no cover
135+
except ft.AuthError as e:
136+
assert "unexpected auth" in str(e)
132137

133138
def test_methods(api):
134139
res = api.get("/who-am-i", login="susie", status=200, cookies={"lang": "it"})

0 commit comments

Comments
 (0)