mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-07 15:04:58 -04:00
Update black, and run auto formatting over the codebase (#9381)
- Update black version to the latest
- Run black auto formatting over the codebase
- Run autoformatting according to [`docs/code_style.md
`](80d6dc9783/docs/code_style.md
)
- Update `code_style.md` docs around installing black to use the correct version
This commit is contained in:
parent
5636e597c3
commit
0a00b7ff14
271 changed files with 2802 additions and 1713 deletions
|
@ -166,9 +166,12 @@ class RestHelper:
|
|||
json.dumps(data).encode("utf8"),
|
||||
)
|
||||
|
||||
assert int(channel.result["code"]) == expect_code, (
|
||||
"Expected: %d, got: %d, resp: %r"
|
||||
% (expect_code, int(channel.result["code"]), channel.result["body"])
|
||||
assert (
|
||||
int(channel.result["code"]) == expect_code
|
||||
), "Expected: %d, got: %d, resp: %r" % (
|
||||
expect_code,
|
||||
int(channel.result["code"]),
|
||||
channel.result["body"],
|
||||
)
|
||||
|
||||
self.auth_user_id = temp_id
|
||||
|
@ -201,9 +204,12 @@ class RestHelper:
|
|||
json.dumps(content).encode("utf8"),
|
||||
)
|
||||
|
||||
assert int(channel.result["code"]) == expect_code, (
|
||||
"Expected: %d, got: %d, resp: %r"
|
||||
% (expect_code, int(channel.result["code"]), channel.result["body"])
|
||||
assert (
|
||||
int(channel.result["code"]) == expect_code
|
||||
), "Expected: %d, got: %d, resp: %r" % (
|
||||
expect_code,
|
||||
int(channel.result["code"]),
|
||||
channel.result["body"],
|
||||
)
|
||||
|
||||
return channel.json_body
|
||||
|
@ -251,9 +257,12 @@ 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"
|
||||
% (expect_code, int(channel.result["code"]), channel.result["body"])
|
||||
assert (
|
||||
int(channel.result["code"]) == expect_code
|
||||
), "Expected: %d, got: %d, resp: %r" % (
|
||||
expect_code,
|
||||
int(channel.result["code"]),
|
||||
channel.result["body"],
|
||||
)
|
||||
|
||||
return channel.json_body
|
||||
|
@ -447,7 +456,10 @@ class RestHelper:
|
|||
return self.complete_oidc_auth(oauth_uri, cookies, user_info_dict)
|
||||
|
||||
def complete_oidc_auth(
|
||||
self, oauth_uri: str, cookies: Mapping[str, str], user_info_dict: JsonDict,
|
||||
self,
|
||||
oauth_uri: str,
|
||||
cookies: Mapping[str, str],
|
||||
user_info_dict: JsonDict,
|
||||
) -> FakeChannel:
|
||||
"""Mock out an OIDC authentication flow
|
||||
|
||||
|
@ -491,7 +503,9 @@ class RestHelper:
|
|||
(expected_uri, resp_obj) = expected_requests.pop(0)
|
||||
assert uri == expected_uri
|
||||
resp = FakeResponse(
|
||||
code=200, phrase=b"OK", body=json.dumps(resp_obj).encode("utf-8"),
|
||||
code=200,
|
||||
phrase=b"OK",
|
||||
body=json.dumps(resp_obj).encode("utf-8"),
|
||||
)
|
||||
return resp
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue