feat: add -c/--config flag to every command
This commit is contained in:
parent
570c29d9f1
commit
6f45b76579
10 changed files with 163 additions and 51 deletions
|
|
@ -8,18 +8,26 @@ from halig.settings import Settings
|
|||
|
||||
def test_show_raises_note_path_does_not_exist(notes, settings: Settings):
|
||||
with pytest.raises(ValueError, match="does not exist"):
|
||||
ShowCommand(Path('foo'), settings=settings, )
|
||||
ShowCommand(
|
||||
Path("foo"),
|
||||
settings=settings,
|
||||
)
|
||||
|
||||
|
||||
def test_show_raises_note_path_is_not_age_valid(notes, settings: Settings):
|
||||
note_path = settings.notebooks_root_path / "foo.txt"
|
||||
note_path.touch()
|
||||
with pytest.raises(ValueError, match="is not a valid AGE file"):
|
||||
ShowCommand(note_path, settings=settings, )
|
||||
ShowCommand(
|
||||
note_path,
|
||||
settings=settings,
|
||||
)
|
||||
|
||||
|
||||
def test_show_current_note(current_note, settings):
|
||||
show_command = ShowCommand(note_path=settings.notebooks_root_path, settings=settings)
|
||||
show_command = ShowCommand(
|
||||
note_path=settings.notebooks_root_path, settings=settings
|
||||
)
|
||||
assert show_command.note_path == current_note
|
||||
assert show_command.decrypt() == "foo"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue