Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
More complete test
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Jun 26, 2023
1 parent 92c4436 commit 157e1b6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/rest/client/test_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ async def check_login_for_spam(
Literal["NOT_SPAM"],
Tuple["synapse.module_api.errors.Codes", JsonDict],
]:
return Codes.FORBIDDEN, {}
# Return an odd set of values to ensure that they get correctly passed
# to the client.
return Codes.LIMIT_EXCEEDED, {"extra": "value"}


class LoginRestServletTestCase(unittest.HomeserverTestCase):
Expand Down Expand Up @@ -567,6 +569,9 @@ def test_spam_checker_deny(self) -> None:
body,
)
self.assertEqual(channel.code, 403, channel.result)
self.assertDictContainsSubset(
{"errcode": Codes.LIMIT_EXCEEDED, "extra": "value"}, channel.json_body
)


@skip_unless(has_saml2 and HAS_OIDC, "Requires SAML2 and OIDC")
Expand Down

0 comments on commit 157e1b6

Please sign in to comment.