mirror of https://github.com/zulip/zulip.git
ruff: Fix SIM118 Use `k in d` instead of `k in d.keys()`.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
6303ebfc2f
commit
25346bde98
|
@ -268,9 +268,7 @@ def normalize_fixture_data(
|
|||
f'"{timestamp_field}": 1[5-9][0-9]{{8}}(?![0-9-])'
|
||||
] = f'"{timestamp_field}": 1{i+1:02}%07d'
|
||||
|
||||
normalized_values: Dict[str, Dict[str, str]] = {
|
||||
pattern: {} for pattern in pattern_translations.keys()
|
||||
}
|
||||
normalized_values: Dict[str, Dict[str, str]] = {pattern: {} for pattern in pattern_translations}
|
||||
for fixture_file in fixture_files_for_function(decorated_function):
|
||||
with open(fixture_file) as f:
|
||||
file_content = f.read()
|
||||
|
|
|
@ -263,7 +263,7 @@ class HomeTest(ZulipTestCase):
|
|||
|
||||
page_params = self._get_page_params(result)
|
||||
|
||||
actual_keys = sorted(str(k) for k in page_params.keys())
|
||||
actual_keys = sorted(str(k) for k in page_params)
|
||||
|
||||
self.assertEqual(actual_keys, self.expected_page_params_keys)
|
||||
|
||||
|
@ -284,7 +284,7 @@ class HomeTest(ZulipTestCase):
|
|||
"user_id",
|
||||
]
|
||||
|
||||
realm_bots_actual_keys = sorted(str(key) for key in page_params["realm_bots"][0].keys())
|
||||
realm_bots_actual_keys = sorted(str(key) for key in page_params["realm_bots"][0])
|
||||
self.assertEqual(realm_bots_actual_keys, realm_bots_expected_keys)
|
||||
|
||||
def test_home_demo_organization(self) -> None:
|
||||
|
@ -307,7 +307,7 @@ class HomeTest(ZulipTestCase):
|
|||
self.check_rendered_logged_in_app(result)
|
||||
|
||||
page_params = self._get_page_params(result)
|
||||
actual_keys = sorted(str(k) for k in page_params.keys())
|
||||
actual_keys = sorted(str(k) for k in page_params)
|
||||
expected_keys = self.expected_page_params_keys + [
|
||||
"demo_organization_scheduled_deletion_date"
|
||||
]
|
||||
|
@ -331,7 +331,7 @@ class HomeTest(ZulipTestCase):
|
|||
# Check no unnecessary params are passed to spectators.
|
||||
page_params = self._get_page_params(result)
|
||||
self.assertEqual(page_params["is_spectator"], True)
|
||||
actual_keys = sorted(str(k) for k in page_params.keys())
|
||||
actual_keys = sorted(str(k) for k in page_params)
|
||||
expected_keys = [
|
||||
"apps_page_url",
|
||||
"bot_types",
|
||||
|
|
|
@ -169,7 +169,7 @@ def get_active_worker_queues(only_test_queues: bool = False) -> List[str]:
|
|||
"""Returns all (either test, or real) worker queues."""
|
||||
return [
|
||||
queue_name
|
||||
for queue_name in worker_classes.keys()
|
||||
for queue_name in worker_classes
|
||||
if bool(queue_name in test_queues) == only_test_queues
|
||||
]
|
||||
|
||||
|
|
Loading…
Reference in New Issue