mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-28 13:36:14 +02:00
Add tests for core feature to pytest-bdd
- Implement "the output should contain" step Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
This commit is contained in:
parent
0b50ae1be0
commit
3055cca767
3 changed files with 21 additions and 0 deletions
|
@ -91,3 +91,10 @@ def matches_std_output(regex, cli_run):
|
|||
out = cli_run["stdout"]
|
||||
matches = re.findall(regex, out)
|
||||
assert matches, f"\nRegex didn't match:\n{regex}\n{str(out)}\n{str(matches)}"
|
||||
|
||||
|
||||
@then(parse("the output should contain\n{text}"))
|
||||
@then(parse('the output should contain "{text}"'))
|
||||
def check_output_inline(text, cli_run):
|
||||
assert text and text in cli_run['stdout']
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue