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

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Dec 5, 2022
1 parent 630ac59 commit 6c37dab
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/rest/admin/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -3994,7 +3994,7 @@ def test_user_is_not_local(self, method: str) -> None:
"""
Tests that shadow-banning for a user that is not a local returns a 400
"""
url = "/_synapse/admin/v1/whois/@unknown_person:unknown_domain"
url = "/_synapse/admin/v1/users/@unknown_person:unknown_domain/shadow_ban"

channel = self.make_request(method, url, access_token=self.admin_user_tok)
self.assertEqual(400, channel.code, msg=channel.json_body)
Expand Down
4 changes: 2 additions & 2 deletions tests/rest/client/test_login_token_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ def prepare(self, reactor: MemoryReactor, clock: Clock, hs: HomeServer) -> None:

def test_disabled(self) -> None:
channel = self.make_request("POST", endpoint, {}, access_token=None)
self.assertEqual(channel.code, 400)
self.assertEqual(channel.code, 404)

self.register_user(self.user, self.password)
token = self.login(self.user, self.password)

channel = self.make_request("POST", endpoint, {}, access_token=token)
self.assertEqual(channel.code, 400)
self.assertEqual(channel.code, 404)

@override_config({"experimental_features": {"msc3882_enabled": True}})
def test_require_auth(self) -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/rest/client/test_rendezvous.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def make_homeserver(self, reactor: MemoryReactor, clock: Clock) -> HomeServer:

def test_disabled(self) -> None:
channel = self.make_request("POST", endpoint, {}, access_token=None)
self.assertEqual(channel.code, 400)
self.assertEqual(channel.code, 404)

@override_config({"experimental_features": {"msc3886_endpoint": "/asd"}})
def test_redirect(self) -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def _callback(request: SynapseRequest, **kwargs: object) -> None:
self.reactor, FakeSite(res, self.reactor), b"GET", b"/_matrix/foobar"
)

self.assertEqual(channel.code, 400)
self.assertEqual(channel.code, 404)
self.assertEqual(channel.json_body["error"], "Unrecognized request")
self.assertEqual(channel.json_body["errcode"], "M_UNRECOGNIZED")

Expand Down

0 comments on commit 6c37dab

Please sign in to comment.