mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
Remove unneeded exception when editor is empty and fix test that was testing incorrect message
This commit is contained in:
parent
2e06e3d4eb
commit
1873f69ded
2 changed files with 8 additions and 11 deletions
|
@ -44,9 +44,6 @@ def get_text_from_editor(config: dict, template: str = "") -> str:
|
|||
raw = f.read()
|
||||
os.remove(tmpfile)
|
||||
|
||||
if not raw:
|
||||
raise JrnlException(Message(MsgText.NoTextReceived, MsgStyle.NORMAL))
|
||||
|
||||
return raw
|
||||
|
||||
|
||||
|
|
|
@ -78,19 +78,19 @@ Feature: Writing new entries.
|
|||
|
||||
Scenario Outline: Writing an empty entry from the editor should yield "No entry to save" message
|
||||
Given we use the config "<config_file>"
|
||||
And we write nothing to the editor if opened
|
||||
And we append nothing to the editor if opened
|
||||
And we use the password "test" if prompted
|
||||
When we run "jrnl --edit"
|
||||
Then the error output should contain "No entry to save, because no text was received"
|
||||
Then the error output should contain "No edits to save, because nothing was changed"
|
||||
And the editor should have been called
|
||||
|
||||
Examples: configs
|
||||
| config_file |
|
||||
| editor.yaml |
|
||||
| editor_empty_folder.yaml |
|
||||
| dayone.yaml |
|
||||
| basic_encrypted.yaml |
|
||||
| basic_onefile.yaml |
|
||||
| basic_encrypted.yaml |
|
||||
| basic_dayone.yaml |
|
||||
| basic_folder.yaml |
|
||||
|
||||
Scenario Outline: Writing an empty entry from the command line should yield "No entry to save" message
|
||||
Given we use the config "<config_file>"
|
||||
|
|
Loading…
Add table
Reference in a new issue