mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-10 13:24:59 -04:00
Use literals in place of HTTPStatus
constants in tests (#13463)
This commit is contained in:
parent
3d2cabf966
commit
e2ed1b7155
18 changed files with 172 additions and 191 deletions
|
@ -140,7 +140,7 @@ class RestHelper:
|
|||
custom_headers=custom_headers,
|
||||
)
|
||||
|
||||
assert channel.result["code"] == b"%d" % expect_code, channel.result
|
||||
assert channel.code == expect_code, channel.result
|
||||
self.auth_user_id = temp_id
|
||||
|
||||
if expect_code == HTTPStatus.OK:
|
||||
|
@ -213,11 +213,9 @@ class RestHelper:
|
|||
data,
|
||||
)
|
||||
|
||||
assert (
|
||||
int(channel.result["code"]) == expect_code
|
||||
), "Expected: %d, got: %d, resp: %r" % (
|
||||
assert channel.code == expect_code, "Expected: %d, got: %d, resp: %r" % (
|
||||
expect_code,
|
||||
int(channel.result["code"]),
|
||||
channel.code,
|
||||
channel.result["body"],
|
||||
)
|
||||
|
||||
|
@ -312,11 +310,9 @@ class RestHelper:
|
|||
data,
|
||||
)
|
||||
|
||||
assert (
|
||||
int(channel.result["code"]) == expect_code
|
||||
), "Expected: %d, got: %d, resp: %r" % (
|
||||
assert channel.code == expect_code, "Expected: %d, got: %d, resp: %r" % (
|
||||
expect_code,
|
||||
int(channel.result["code"]),
|
||||
channel.code,
|
||||
channel.result["body"],
|
||||
)
|
||||
|
||||
|
@ -396,11 +392,9 @@ class RestHelper:
|
|||
custom_headers=custom_headers,
|
||||
)
|
||||
|
||||
assert (
|
||||
int(channel.result["code"]) == expect_code
|
||||
), "Expected: %d, got: %d, resp: %r" % (
|
||||
assert channel.code == expect_code, "Expected: %d, got: %d, resp: %r" % (
|
||||
expect_code,
|
||||
int(channel.result["code"]),
|
||||
channel.code,
|
||||
channel.result["body"],
|
||||
)
|
||||
|
||||
|
@ -449,11 +443,9 @@ class RestHelper:
|
|||
|
||||
channel = make_request(self.hs.get_reactor(), self.site, method, path, content)
|
||||
|
||||
assert (
|
||||
int(channel.result["code"]) == expect_code
|
||||
), "Expected: %d, got: %d, resp: %r" % (
|
||||
assert channel.code == expect_code, "Expected: %d, got: %d, resp: %r" % (
|
||||
expect_code,
|
||||
int(channel.result["code"]),
|
||||
channel.code,
|
||||
channel.result["body"],
|
||||
)
|
||||
|
||||
|
@ -545,7 +537,7 @@ class RestHelper:
|
|||
|
||||
assert channel.code == expect_code, "Expected: %d, got: %d, resp: %r" % (
|
||||
expect_code,
|
||||
int(channel.result["code"]),
|
||||
channel.code,
|
||||
channel.result["body"],
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue