mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-05 07:56:14 +02:00
begin TDD of dot notated overrides
This commit is contained in:
parent
9676290c27
commit
80d2c609ba
4 changed files with 41 additions and 9 deletions
|
@ -4,7 +4,7 @@ import mock
|
|||
|
||||
import yaml
|
||||
from jrnl.args import parse_args
|
||||
from jrnl.jrnl import run
|
||||
from jrnl.jrnl import run, search_mode
|
||||
from jrnl import install
|
||||
|
||||
|
||||
|
@ -43,7 +43,7 @@ def test_override_configured_editor(
|
|||
cli_args = ["--config-override", '{"editor": "nano"}']
|
||||
parser = parse_args(cli_args)
|
||||
assert parser.config_override.__len__() == 1
|
||||
|
||||
assert "editor" in parser.config_override.keys()
|
||||
def mock_editor_launch(editor):
|
||||
print("%s launched! Success!" % editor)
|
||||
|
||||
|
@ -55,3 +55,22 @@ def test_override_configured_editor(
|
|||
) as mock_write_in_editor:
|
||||
run(parser)
|
||||
mock_write_in_editor.assert_called_once_with(expected_override)
|
||||
|
||||
@pytest.fixture()
|
||||
def expected_color_override(minimal_config):
|
||||
exp_out_cfg = minimal_config.copy()
|
||||
exp_out_cfg["colors"] = {"body": "blue"}
|
||||
exp_out_cfg["journal"] = "features/journals/simple.journal"
|
||||
yield exp_out_cfg
|
||||
|
||||
# @mock.patch.object(install,'load_or_install_jrnl')
|
||||
# @mock.patch('subprocess.call')
|
||||
# def test_override_configured_colors(mock_load_or_install, mock_subprocess_call, minimal_config, expected_color_override, capsys):
|
||||
# mock_load_or_install.return_value = minimal_config
|
||||
|
||||
# cli_args=["--config-override",'{"colors.body": "blue"}']
|
||||
# parser = parse_args(cli_args)
|
||||
# assert "colors.body" in parser.config_override.keys()
|
||||
# run(parser)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue