mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 08:24:55 -04:00
Clarify list/set/dict/tuple comprehensions and enforce via flake8 (#6957)
Ensure good comprehension hygiene using flake8-comprehensions.
This commit is contained in:
parent
272eee1ae1
commit
509e381afa
73 changed files with 251 additions and 276 deletions
|
@ -69,14 +69,14 @@ class ApplicationServiceStoreTestCase(unittest.TestCase):
|
|||
pass
|
||||
|
||||
def _add_appservice(self, as_token, id, url, hs_token, sender):
|
||||
as_yaml = dict(
|
||||
url=url,
|
||||
as_token=as_token,
|
||||
hs_token=hs_token,
|
||||
id=id,
|
||||
sender_localpart=sender,
|
||||
namespaces={},
|
||||
)
|
||||
as_yaml = {
|
||||
"url": url,
|
||||
"as_token": as_token,
|
||||
"hs_token": hs_token,
|
||||
"id": id,
|
||||
"sender_localpart": sender,
|
||||
"namespaces": {},
|
||||
}
|
||||
# use the token as the filename
|
||||
with open(as_token, "w") as outfile:
|
||||
outfile.write(yaml.dump(as_yaml))
|
||||
|
@ -135,14 +135,14 @@ class ApplicationServiceTransactionStoreTestCase(unittest.TestCase):
|
|||
)
|
||||
|
||||
def _add_service(self, url, as_token, id):
|
||||
as_yaml = dict(
|
||||
url=url,
|
||||
as_token=as_token,
|
||||
hs_token="something",
|
||||
id=id,
|
||||
sender_localpart="a_sender",
|
||||
namespaces={},
|
||||
)
|
||||
as_yaml = {
|
||||
"url": url,
|
||||
"as_token": as_token,
|
||||
"hs_token": "something",
|
||||
"id": id,
|
||||
"sender_localpart": "a_sender",
|
||||
"namespaces": {},
|
||||
}
|
||||
# use the token as the filename
|
||||
with open(as_token, "w") as outfile:
|
||||
outfile.write(yaml.dump(as_yaml))
|
||||
|
@ -384,8 +384,8 @@ class ApplicationServiceTransactionStoreTestCase(unittest.TestCase):
|
|||
)
|
||||
self.assertEquals(2, len(services))
|
||||
self.assertEquals(
|
||||
set([self.as_list[2]["id"], self.as_list[0]["id"]]),
|
||||
set([services[0].id, services[1].id]),
|
||||
{self.as_list[2]["id"], self.as_list[0]["id"]},
|
||||
{services[0].id, services[1].id},
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue