chore: fix formatting checks
This commit is contained in:
@@ -53,9 +53,7 @@ class AdminWebappRuntimeTests(unittest.IsolatedAsyncioTestCase):
|
||||
"invalidate_all_webapp_user_payloads",
|
||||
AsyncMock(),
|
||||
),
|
||||
patch(
|
||||
"bot.app.web.admin_api_impl.themes.prune_unused_appearance_assets"
|
||||
) as prune_mock,
|
||||
patch("bot.app.web.admin_api_impl.themes.prune_unused_appearance_assets") as prune_mock,
|
||||
):
|
||||
await webapp_runtime.refresh_webapp_runtime_after_settings_change(
|
||||
request,
|
||||
|
||||
@@ -35,8 +35,7 @@ def test_telegram_startup_network_error_retries_until_success_without_traceback(
|
||||
assert calls == ["try", "try", "try"]
|
||||
assert "Telegram network error while registering mini app menu button" in caplog.text
|
||||
assert (
|
||||
"Telegram step succeeded while registering mini app menu button on attempt 3"
|
||||
in caplog.text
|
||||
"Telegram step succeeded while registering mini app menu button on attempt 3" in caplog.text
|
||||
)
|
||||
assert "api.telegram.org" in caplog.text
|
||||
assert "Temporary failure in name resolution" in caplog.text
|
||||
|
||||
@@ -761,9 +761,7 @@ class AdminSettingsSecurityTests(unittest.IsolatedAsyncioTestCase):
|
||||
|
||||
payload = json.loads(response.text)
|
||||
fields = {
|
||||
field["key"]: field
|
||||
for section in payload["sections"]
|
||||
for field in section["fields"]
|
||||
field["key"]: field for section in payload["sections"] for field in section["fields"]
|
||||
}
|
||||
|
||||
self.assertEqual(
|
||||
|
||||
@@ -163,9 +163,7 @@ def test_unsafe_svg_is_rejected():
|
||||
|
||||
def test_unsafe_external_link_is_rejected():
|
||||
config = _config()
|
||||
config["platforms"]["ios"]["apps"][0]["blocks"][0]["buttons"][0][
|
||||
"link"
|
||||
] = "javascript:alert(1)"
|
||||
config["platforms"]["ios"]["apps"][0]["blocks"][0]["buttons"][0]["link"] = "javascript:alert(1)"
|
||||
|
||||
with pytest.raises(SubscriptionGuidesConfigError, match="unsafe URL scheme"):
|
||||
validate_subscription_guides_config(config)
|
||||
@@ -173,9 +171,9 @@ def test_unsafe_external_link_is_rejected():
|
||||
|
||||
def test_external_custom_scheme_is_allowed_for_multiapp_compatibility():
|
||||
config = _config()
|
||||
config["platforms"]["ios"]["apps"][0]["blocks"][0]["buttons"][0][
|
||||
"link"
|
||||
] = "streisand://import/demo"
|
||||
config["platforms"]["ios"]["apps"][0]["blocks"][0]["buttons"][0]["link"] = (
|
||||
"streisand://import/demo"
|
||||
)
|
||||
|
||||
validated = validate_subscription_guides_config(config)
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ class SubscriptionGuidesRouteTests(unittest.IsolatedAsyncioTestCase):
|
||||
"uuid": default_uuid,
|
||||
"config": json.loads(default_subscription_guides_config_text()),
|
||||
}
|
||||
)
|
||||
),
|
||||
)
|
||||
request = self._request(self._settings(), panel_service)
|
||||
|
||||
@@ -113,7 +113,7 @@ class SubscriptionGuidesRouteTests(unittest.IsolatedAsyncioTestCase):
|
||||
"uuid": default_uuid,
|
||||
"config": json.loads(default_subscription_guides_config_text()),
|
||||
}
|
||||
)
|
||||
),
|
||||
)
|
||||
request = self._request(
|
||||
self._settings(SUBSCRIPTION_PAGE_CONFIG_JSON=json.dumps(admin_config)),
|
||||
|
||||
@@ -396,7 +396,10 @@ class WebappThemesConfigTests(unittest.TestCase):
|
||||
self.assertIn("New webapp surfaces: support, purchase info, password login", css)
|
||||
self.assertIn("Install guide theme surfaces", css)
|
||||
self.assertIn(
|
||||
".theme-key-windows95 .support-list-card {\n grid-template-rows: auto auto minmax(0, 1fr);",
|
||||
(
|
||||
".theme-key-windows95 .support-list-card {\n"
|
||||
" grid-template-rows: auto auto minmax(0, 1fr);"
|
||||
),
|
||||
css,
|
||||
)
|
||||
self.assertIn(".theme-key-windows95 .traffic-top strong", css)
|
||||
|
||||
Reference in New Issue
Block a user