Loading tests/steps/pages.py +2 −4 Original line number Diff line number Diff line # Copyright 2021-2022 Dominik Sekotill <dom.sekotill@kodo.org.uk> # Copyright 2021-2023 Dominik Sekotill <dom.sekotill@kodo.org.uk> # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this Loading Loading @@ -64,9 +64,7 @@ def create_post(context: Context, post_type: PostType, text: str|None = None) -> """ Create a WP post of the given type and store it in the context with the type as the name """ text = text or getattr(context, "text", "") assert isinstance(text, str) post = use_fixture(wp_post, context, post_type, text) post = use_fixture(wp_post, context, post_type, text or context.text or "") setattr(context, post_type.value, post) Loading tests/steps/static.py +2 −2 Original line number Diff line number Diff line # Copyright 2022 Dominik Sekotill <dom.sekotill@kodo.org.uk> # Copyright 2022-2023 Dominik Sekotill <dom.sekotill@kodo.org.uk> # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this Loading Loading @@ -34,6 +34,6 @@ def container_file(context: Context, path: str, container_name: str) -> Iterator """ container = getattr(context.site, container_name) run = Cli(container) run("tee", path, input=getattr(context, "text", "This is a data file!")) run("tee", path, input=(context.text or "This is a data file!")) yield run("rm", path) Loading
tests/steps/pages.py +2 −4 Original line number Diff line number Diff line # Copyright 2021-2022 Dominik Sekotill <dom.sekotill@kodo.org.uk> # Copyright 2021-2023 Dominik Sekotill <dom.sekotill@kodo.org.uk> # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this Loading Loading @@ -64,9 +64,7 @@ def create_post(context: Context, post_type: PostType, text: str|None = None) -> """ Create a WP post of the given type and store it in the context with the type as the name """ text = text or getattr(context, "text", "") assert isinstance(text, str) post = use_fixture(wp_post, context, post_type, text) post = use_fixture(wp_post, context, post_type, text or context.text or "") setattr(context, post_type.value, post) Loading
tests/steps/static.py +2 −2 Original line number Diff line number Diff line # Copyright 2022 Dominik Sekotill <dom.sekotill@kodo.org.uk> # Copyright 2022-2023 Dominik Sekotill <dom.sekotill@kodo.org.uk> # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this Loading Loading @@ -34,6 +34,6 @@ def container_file(context: Context, path: str, container_name: str) -> Iterator """ container = getattr(context.site, container_name) run = Cli(container) run("tee", path, input=getattr(context, "text", "This is a data file!")) run("tee", path, input=(context.text or "This is a data file!")) yield run("rm", path)