From e6918187568dbd01842d8d1d2c808ce16a894239 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 21 Apr 2024 13:54:28 +0200 Subject: Adding upstream version 18.2.2. Signed-off-by: Daniel Baumann --- .../rook/ci/tests/features/steps/implementation.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/pybind/mgr/rook/ci/tests/features/steps/implementation.py (limited to 'src/pybind/mgr/rook/ci/tests/features/steps/implementation.py') diff --git a/src/pybind/mgr/rook/ci/tests/features/steps/implementation.py b/src/pybind/mgr/rook/ci/tests/features/steps/implementation.py new file mode 100644 index 000000000..adde61afd --- /dev/null +++ b/src/pybind/mgr/rook/ci/tests/features/steps/implementation.py @@ -0,0 +1,21 @@ +from behave import * +from utils import * +import re + +@when("I run") +def run_step(context): + context.output = run_commands(context.text) + +@then("I get") +def verify_result_step(context): + print(f"Output is:\n{context.output}\n--------------\n") + assert context.text == context.output + +@then("I get something like") +def verify_fuzzy_result_step(context): + output_lines = context.output.split("\n") + expected_lines = context.text.split("\n") + num_lines = min(len(output_lines), len(expected_lines)) + for n in range(num_lines): + if not re.match(expected_lines[n], output_lines[n]): + raise -- cgit v1.2.3