mirror of https://github.com/zulip/zulip.git
ruff: Fix C417 Unnecessary `map` usage.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
ab864be904
commit
3d853caf16
|
@ -94,7 +94,7 @@ class Integration:
|
||||||
+ category
|
+ category
|
||||||
+ "' is not a key in CATEGORIES.",
|
+ "' is not a key in CATEGORIES.",
|
||||||
)
|
)
|
||||||
self.categories = list(map((lambda c: CATEGORIES[c]), categories))
|
self.categories = [CATEGORIES[c] for c in categories]
|
||||||
|
|
||||||
self.logo_path = logo if logo is not None else self.get_logo_path()
|
self.logo_path = logo if logo is not None else self.get_logo_path()
|
||||||
# TODO: Enforce that all integrations have logo_url with an assertion.
|
# TODO: Enforce that all integrations have logo_url with an assertion.
|
||||||
|
|
|
@ -235,7 +235,7 @@ class MarkdownMiscTest(ZulipTestCase):
|
||||||
lst = get_possible_mentions_info(
|
lst = get_possible_mentions_info(
|
||||||
mention_backend, {"Fred Flintstone", "Cordelia, LEAR's daughter", "Not A User"}
|
mention_backend, {"Fred Flintstone", "Cordelia, LEAR's daughter", "Not A User"}
|
||||||
)
|
)
|
||||||
set_of_names = set(map(lambda x: x.full_name.lower(), lst))
|
set_of_names = {x.full_name.lower() for x in lst}
|
||||||
self.assertEqual(set_of_names, {"fred flintstone", "cordelia, lear's daughter"})
|
self.assertEqual(set_of_names, {"fred flintstone", "cordelia, lear's daughter"})
|
||||||
|
|
||||||
by_id = {row.id: row for row in lst}
|
by_id = {row.id: row for row in lst}
|
||||||
|
|
|
@ -5700,8 +5700,8 @@ class GetSubscribersTest(ZulipTestCase):
|
||||||
|
|
||||||
# It's +1 because of the stream Rome.
|
# It's +1 because of the stream Rome.
|
||||||
self.assert_length(never_sub, len(web_public_streams) + 1)
|
self.assert_length(never_sub, len(web_public_streams) + 1)
|
||||||
sub_ids = list(map(lambda stream: stream["stream_id"], sub))
|
sub_ids = [stream["stream_id"] for stream in sub]
|
||||||
unsub_ids = list(map(lambda stream: stream["stream_id"], unsub))
|
unsub_ids = [stream["stream_id"] for stream in unsub]
|
||||||
|
|
||||||
for stream_dict in never_sub:
|
for stream_dict in never_sub:
|
||||||
self.assertTrue(stream_dict["is_web_public"])
|
self.assertTrue(stream_dict["is_web_public"])
|
||||||
|
|
Loading…
Reference in New Issue