mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-03 15:16:12 +02:00
Allow custom file extensions for directory journal
This commit is contained in:
parent
c8c49b1ba2
commit
6b742fd412
6 changed files with 43 additions and 11 deletions
|
@ -10,6 +10,13 @@ Feature: Journals iteracting with the file system in a way that users can see
|
|||
And the journal directory should contain
|
||||
2013/07/23.txt
|
||||
|
||||
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."
|
||||
|
|
13
tests/data/configs/empty_folder_with_extension.yaml
Normal file
13
tests/data/configs/empty_folder_with_extension.yaml
Normal 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: "|"
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue