mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-28 13:36:14 +02:00
Add ability to use template with --template
(#1667)
* Add ability to pass template path with --template Update jrnl/args.py * Fix tests
This commit is contained in:
parent
0725ea6b87
commit
a2b217fdfc
12 changed files with 217 additions and 68 deletions
|
@ -89,6 +89,7 @@ def cli_run(
|
|||
mock_user_input,
|
||||
mock_overrides,
|
||||
mock_default_journal_path,
|
||||
mock_default_templates_path,
|
||||
):
|
||||
# Check if we need more mocks
|
||||
mock_factories.update(mock_args)
|
||||
|
@ -98,6 +99,7 @@ def cli_run(
|
|||
mock_factories.update(mock_config_path)
|
||||
mock_factories.update(mock_user_input)
|
||||
mock_factories.update(mock_default_journal_path)
|
||||
mock_factories.update(mock_default_templates_path)
|
||||
|
||||
return {
|
||||
"status": 0,
|
||||
|
@ -179,6 +181,16 @@ def mock_default_journal_path(temp_dir):
|
|||
}
|
||||
|
||||
|
||||
@fixture
|
||||
def mock_default_templates_path(temp_dir):
|
||||
templates_path = Path(temp_dir.name, "templates")
|
||||
return {
|
||||
"get_templates_path": lambda: patch(
|
||||
"jrnl.controller.get_templates_path", return_value=templates_path
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
@fixture
|
||||
def temp_dir():
|
||||
return tempfile.TemporaryDirectory()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue