mirror of
https://github.com/zvx-echo6/central.git
synced 2026-06-10 11:54:37 +02:00
Merge pull request #80 from zvx-echo6/v0_9_18_1_test_gui_ruff_cleanup
v0.9.18.1 — ruff cleanup: tests/test_gui_adapter_edit.py (3 violations -> 0)
This commit is contained in:
commit
7b13ea1886
1 changed files with 5 additions and 3 deletions
|
|
@ -13,7 +13,7 @@ from central.gui import templates as gui_templates
|
||||||
from central.gui.form_descriptors import describe_fields
|
from central.gui.form_descriptors import describe_fields
|
||||||
from central.gui.routes import adapters_edit_form, adapters_edit_submit
|
from central.gui.routes import adapters_edit_form, adapters_edit_submit
|
||||||
from central.adapters.tomtom_incidents import (
|
from central.adapters.tomtom_incidents import (
|
||||||
TomTomIncidentsAdapter, TomTomIncidentsSettings, TOMTOM_FREE_TIER_CALLS_PER_MONTH,
|
TomTomIncidentsAdapter, TomTomIncidentsSettings,
|
||||||
)
|
)
|
||||||
|
|
||||||
_BBOXES = [
|
_BBOXES = [
|
||||||
|
|
@ -139,7 +139,8 @@ def _bbox_pairs(i, name, state="ID", cadence=None, **coords):
|
||||||
|
|
||||||
async def _submit_expect_422(pairs, cadence_s="1800"):
|
async def _submit_expect_422(pairs, cadence_s="1800"):
|
||||||
pool, _ = _pool()
|
pool, _ = _pool()
|
||||||
tmpl = MagicMock(); tmpl.TemplateResponse.return_value = MagicMock()
|
tmpl = MagicMock()
|
||||||
|
tmpl.TemplateResponse.return_value = MagicMock()
|
||||||
with patch("central.gui.routes._get_templates", return_value=tmpl), \
|
with patch("central.gui.routes._get_templates", return_value=tmpl), \
|
||||||
patch("central.gui.routes.get_pool", return_value=pool), \
|
patch("central.gui.routes.get_pool", return_value=pool), \
|
||||||
patch("central.gui.routes.adapter_has_resolved_api_key",
|
patch("central.gui.routes.adapter_has_resolved_api_key",
|
||||||
|
|
@ -199,7 +200,8 @@ class TestGetRoute:
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_get_200_with_quota_in_context(self):
|
async def test_get_200_with_quota_in_context(self):
|
||||||
pool, _ = _pool()
|
pool, _ = _pool()
|
||||||
tmpl = MagicMock(); tmpl.TemplateResponse.return_value = MagicMock(status_code=200)
|
tmpl = MagicMock()
|
||||||
|
tmpl.TemplateResponse.return_value = MagicMock(status_code=200)
|
||||||
req = MagicMock()
|
req = MagicMock()
|
||||||
req.state.operator = SimpleNamespace(id=1, username="admin")
|
req.state.operator = SimpleNamespace(id=1, username="admin")
|
||||||
req.state.csrf_token = "x"
|
req.state.csrf_token = "x"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue