Skip to content

Commit 51f99f3

Browse files
committed
re-adding test that went missing
1 parent 889eafb commit 51f99f3

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

tests/unit_tests/cli/test_cli.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,6 +1138,26 @@ def test_login_with_unauthenticated_server(
11381138
assert result.exit_code == 0
11391139

11401140

1141+
@responses.activate
1142+
def test_invalid_json(
1143+
runner: CliRunner,
1144+
config_with_auth: str,
1145+
mock_authn_server: responses.RequestsMock,
1146+
):
1147+
response = responses.add(
1148+
responses.GET,
1149+
"http://localhost:8000/config/oidc",
1150+
body="blah blah",
1151+
status=404,
1152+
)
1153+
1154+
result = runner.invoke(main, ["-c", config_with_auth, "login"])
1155+
1156+
assert response.call_count == 1
1157+
assert "Response does not contain a valid JSON object\n" == result.output
1158+
assert result.exit_code == 0
1159+
1160+
11411161
def test_logout_success(
11421162
runner: CliRunner,
11431163
config_with_auth: str,

0 commit comments

Comments
 (0)