mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 21:54:55 -04:00
Replace request.code
with channel.code
The two are equivalent, but really we want to check the HTTP result that got returned to the channel, not the code that the Request object *intended* to return to the channel.
This commit is contained in:
parent
01333681bc
commit
7eebe4b3fc
8 changed files with 22 additions and 22 deletions
|
@ -48,7 +48,7 @@ class ClientReaderTestCase(BaseMultiWorkerStreamTestCase):
|
|||
"register",
|
||||
{"username": "user", "type": "m.login.password", "password": "bar"},
|
||||
) # type: SynapseRequest, FakeChannel
|
||||
self.assertEqual(request_1.code, 401)
|
||||
self.assertEqual(channel_1.code, 401)
|
||||
|
||||
# Grab the session
|
||||
session = channel_1.json_body["session"]
|
||||
|
@ -61,7 +61,7 @@ class ClientReaderTestCase(BaseMultiWorkerStreamTestCase):
|
|||
"register",
|
||||
{"auth": {"session": session, "type": "m.login.dummy"}},
|
||||
) # type: SynapseRequest, FakeChannel
|
||||
self.assertEqual(request_2.code, 200)
|
||||
self.assertEqual(channel_2.code, 200)
|
||||
|
||||
# We're given a registered user.
|
||||
self.assertEqual(channel_2.json_body["user_id"], "@user:test")
|
||||
|
@ -80,7 +80,7 @@ class ClientReaderTestCase(BaseMultiWorkerStreamTestCase):
|
|||
"register",
|
||||
{"username": "user", "type": "m.login.password", "password": "bar"},
|
||||
) # type: SynapseRequest, FakeChannel
|
||||
self.assertEqual(request_1.code, 401)
|
||||
self.assertEqual(channel_1.code, 401)
|
||||
|
||||
# Grab the session
|
||||
session = channel_1.json_body["session"]
|
||||
|
@ -94,7 +94,7 @@ class ClientReaderTestCase(BaseMultiWorkerStreamTestCase):
|
|||
"register",
|
||||
{"auth": {"session": session, "type": "m.login.dummy"}},
|
||||
) # type: SynapseRequest, FakeChannel
|
||||
self.assertEqual(request_2.code, 200)
|
||||
self.assertEqual(channel_2.code, 200)
|
||||
|
||||
# We're given a registered user.
|
||||
self.assertEqual(channel_2.json_body["user_id"], "@user:test")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue