diff --git a/plugins/lookup/guide_role.py b/plugins/lookup/guide_role.py index 6388a1c188..a27531c390 100644 --- a/plugins/lookup/guide_role.py +++ b/plugins/lookup/guide_role.py @@ -16,9 +16,7 @@ from plugins.lookup.deployment import running_apps from utils.roles.validation.invokable import list_invokable_app_ids -def guide_role( - application_id: str, running: list[str], invokable: list[str] -) -> str: +def guide_role(application_id: str, running: list[str], invokable: list[str]) -> str: """Return the app whose guide is replayed, ``application_id`` when it is alone. Args: @@ -39,5 +37,9 @@ class LookupModule(LookupBase): **kwargs: Any, ) -> list[str]: vars_ = variables or getattr(self._templar, "available_variables", {}) or {} - application_id = str(terms[0]) if terms else str(vars_.get("application_id", "")) - return [guide_role(application_id, running_apps(vars_), list_invokable_app_ids())] + application_id = ( + str(terms[0]) if terms else str(vars_.get("application_id", "")) + ) + return [ + guide_role(application_id, running_apps(vars_), list_invokable_app_ids()) + ] diff --git a/roles/web-app-docs/files/test/compose.yml b/roles/web-app-docs/files/test/compose.yml index 979686e064..5b3679abf2 100644 --- a/roles/web-app-docs/files/test/compose.yml +++ b/roles/web-app-docs/files/test/compose.yml @@ -1,3 +1,4 @@ +--- services: machine: build: diff --git a/tests/unit/python/plugins/lookup/test_guide_role.py b/tests/unit/python/plugins/lookup/test_guide_role.py index 3a6d0705e0..149e136ea2 100644 --- a/tests/unit/python/plugins/lookup/test_guide_role.py +++ b/tests/unit/python/plugins/lookup/test_guide_role.py @@ -9,7 +9,9 @@ INVOKABLE = ["web-app-docs", "web-app-nextcloud", "svc-db-postgres", "dsk-gnt-cl class TestGuideRole(unittest.TestCase): def test_the_first_invokable_peer_wins(self): self.assertEqual( - guide_role("web-app-docs", ["web-app-docs", "web-app-nextcloud"], INVOKABLE), + guide_role( + "web-app-docs", ["web-app-docs", "web-app-nextcloud"], INVOKABLE + ), "web-app-nextcloud", ) @@ -20,14 +22,18 @@ class TestGuideRole(unittest.TestCase): ) def test_the_asking_role_alone_names_itself(self): - self.assertEqual(guide_role("web-app-docs", ["web-app-docs"], INVOKABLE), "web-app-docs") + self.assertEqual( + guide_role("web-app-docs", ["web-app-docs"], INVOKABLE), "web-app-docs" + ) def test_an_empty_round_names_the_asking_role(self): self.assertEqual(guide_role("web-app-docs", [], INVOKABLE), "web-app-docs") def test_the_round_order_decides_between_two_peers(self): self.assertEqual( - guide_role("web-app-docs", ["svc-db-postgres", "dsk-gnt-claude"], INVOKABLE), + guide_role( + "web-app-docs", ["svc-db-postgres", "dsk-gnt-claude"], INVOKABLE + ), "svc-db-postgres", ) diff --git a/tests/unit/python/roles/web-app-docs/files/infinito_docs/test_build_queue.py b/tests/unit/python/roles/web-app-docs/files/infinito_docs/test_build_queue.py index 05e881235c..e72097a64c 100644 --- a/tests/unit/python/roles/web-app-docs/files/infinito_docs/test_build_queue.py +++ b/tests/unit/python/roles/web-app-docs/files/infinito_docs/test_build_queue.py @@ -49,7 +49,9 @@ class QueueFixture(LibraryFixture): directory = self.library.translations / version directory.mkdir(parents=True, exist_ok=True) (directory / "languages.json").write_text( - json.dumps({"known": {code: code for code in translated}, "translated": translated}), + json.dumps( + {"known": {code: code for code in translated}, "translated": translated} + ), encoding="utf-8", ) diff --git a/tests/unit/python/roles/web-app-docs/files/test/test_extract.py b/tests/unit/python/roles/web-app-docs/files/test/test_extract.py index cc18d51916..350b631570 100644 --- a/tests/unit/python/roles/web-app-docs/files/test/test_extract.py +++ b/tests/unit/python/roles/web-app-docs/files/test/test_extract.py @@ -80,7 +80,9 @@ class TestFetch(unittest.TestCase): mock.patch.object(extract.urllib.request, "urlopen", side_effect=answers), mock.patch.object(extract.time, "sleep"), ): - self.assertEqual(extract.fetch("http://x/", timeout=60, poll=0), "
ok
") + self.assertEqual( + extract.fetch("http://x/", timeout=60, poll=0), "ok
" + ) def test_a_build_that_never_finishes_times_out(self) -> None: with (