mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-28 13:36:14 +02:00
Implement --change-time flag (#1452)
* Implement --change-time flag * Remove todo from --change-time bdd folder journal tests * Add warning when --change-time used with no matching entries * Add a test to make sure running --change-time with nothing prints a warning and doesn't change anything * Add prompt for --change-time * Don't prompt for --change-time when used with --edit and only one entry * When using --edit and --change-time, change the time before editing * Add test for --change-time used with --edit * Modify failing --change-time test to conform to text in develop branch
This commit is contained in:
parent
e6ed64ac7a
commit
33c9dce80d
8 changed files with 342 additions and 12 deletions
|
@ -17,6 +17,7 @@ def expected_args(**kwargs):
|
|||
"contains": None,
|
||||
"debug": False,
|
||||
"delete": False,
|
||||
"change_time": None,
|
||||
"edit": False,
|
||||
"end_date": None,
|
||||
"today_in_history": False,
|
||||
|
@ -58,6 +59,13 @@ def test_delete_alone():
|
|||
assert cli_as_dict("--delete") == expected_args(delete=True)
|
||||
|
||||
|
||||
def test_change_time_alone():
|
||||
assert cli_as_dict("--change-time") == expected_args(change_time="now")
|
||||
assert cli_as_dict("--change-time yesterday") == expected_args(
|
||||
change_time="yesterday"
|
||||
)
|
||||
|
||||
|
||||
def test_diagnostic_alone():
|
||||
from jrnl.commands import preconfig_diagnostic
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue