mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 08:38:32 +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
|
@ -65,6 +65,10 @@ force_sort_within_sections = true
|
||||||
|
|
||||||
[tool.pytest.ini_options]
|
[tool.pytest.ini_options]
|
||||||
minversion = "6.0"
|
minversion = "6.0"
|
||||||
|
markers = [
|
||||||
|
"todo",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry>=1.1"]
|
requires = ["poetry>=1.1"]
|
||||||
|
|
|
@ -6,3 +6,13 @@ Feature: Functionality of jrnl outside of actually handling journals
|
||||||
Then we should get no error
|
Then we should get no error
|
||||||
Then the output should match "^jrnl version v\d+\.\d+(\.\d+)?(-(alpha|beta)\d*)?"
|
Then the output should match "^jrnl version v\d+\.\d+(\.\d+)?(-(alpha|beta)\d*)?"
|
||||||
|
|
||||||
|
Scenario: Running the diagnostic command
|
||||||
|
Given we use the config "simple.yaml"
|
||||||
|
When we run "jrnl --diagnostic"
|
||||||
|
Then the output should contain "jrnl"
|
||||||
|
And the output should contain "Python"
|
||||||
|
And the output should contain "OS"
|
||||||
|
|
||||||
|
@todo
|
||||||
|
Scenario: Listing available journals
|
||||||
|
|
||||||
|
|
|
@ -91,3 +91,10 @@ def matches_std_output(regex, cli_run):
|
||||||
out = cli_run["stdout"]
|
out = cli_run["stdout"]
|
||||||
matches = re.findall(regex, out)
|
matches = re.findall(regex, out)
|
||||||
assert matches, f"\nRegex didn't match:\n{regex}\n{str(out)}\n{str(matches)}"
|
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
Reference in a new issue