mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-28 21:46:13 +02:00
Expand "we run" step to handling input better
- Use regex parser in pytest-bdd to support "we run" steps that also have user input ("and enter") Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
This commit is contained in:
parent
e720430aa4
commit
3d3bd91700
2 changed files with 21 additions and 2 deletions
|
@ -16,6 +16,7 @@ from pytest_bdd import given
|
|||
from pytest_bdd import then
|
||||
from pytest_bdd import when
|
||||
from pytest_bdd.parsers import parse
|
||||
from pytest_bdd import parsers
|
||||
from pytest import fixture
|
||||
import toml
|
||||
|
||||
|
@ -205,11 +206,12 @@ def use_password_forever(pw):
|
|||
return pw
|
||||
|
||||
|
||||
@when(parse('we run "jrnl {command}" and enter\n{user_input}'))
|
||||
@when(parsers.re('we run "jrnl (?P<command>[^"]+)" and enter "(?P<user_input>[^"]+)"'))
|
||||
@when(parse('we run "jrnl {command}"'))
|
||||
@when(parse('we run "jrnl" and enter "{user_input}"'))
|
||||
@when('we run "jrnl <command>"')
|
||||
@when('we run "jrnl"')
|
||||
@when(parse('we run "jrnl" and enter "{user_input}"'))
|
||||
@when(parse('we run "jrnl {command}" and enter\n{user_input}'))
|
||||
def we_run(command, config_path, user_input, cli_run, capsys, password, keyring):
|
||||
args = split_args(command)
|
||||
status = 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue