This commit is contained in:
Thibaud Chupin 2024-11-21 00:27:38 +03:00 committed by GitHub
commit 44749d6ab4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 51 additions and 16 deletions

View file

@ -10,13 +10,22 @@ Feature: Journals iteracting with the file system in a way that users can see
And the journal directory should contain
2013/07/23.txt
@skip_win # https://github.com/jrnl-org/jrnl/issues/1894
Scenario: Adding entries to a Folder journal with a custom extension should generate date files
Given we use the config "empty_folder_with_extension.yaml"
When we run "jrnl 23 July 2013: Testing folder journal."
Then we should get no error
And the journal directory should contain
2013/07/23.md
Scenario: Adding multiple entries to a Folder journal should generate multiple date files
Given we use the config "empty_folder.yaml"
When we run "jrnl 23 July 2013: Testing folder journal."
And we run "jrnl 3/7/2014: Second entry of journal."
And we run "jrnl 5/3/2014: Second entry of journal."
Then we should get no error
And the journal directory should contain
2013/07/23.txt
2014/05/03.txt
Scenario: If the journal and its parent directory don't exist, they should be created
Given we use the config "missing_directory.yaml"

View file

@ -0,0 +1,13 @@
default_hour: 9
default_minute: 0
editor: ''
template: false
encrypt: false
extension: .md
highlight: true
journals:
default: features/journals/empty_folder_with_extension/
linewrap: 80
tagsymbols: '@'
timeformat: '%Y-%m-%d %H:%M'
indent_character: "|"

View file

@ -51,7 +51,7 @@ def test_get_day_files_expected_filtering(inputs_and_outputs):
mock.patch("pathlib.Path.glob", return_value=glob_files),
mock.patch.object(pathlib.Path, "is_file", return_value=True),
):
actual_output = list(Folder._get_day_files(year_month_path))
actual_output = list(Folder._get_day_files(year_month_path, ".txt"))
actual_output.sort()
expected_output.sort()