feat: add -c/--config flag to every command

This commit is contained in:
cătălin 2023-03-04 23:16:00 +02:00
commit 6f45b76579
Signed by: catalin
GPG key ID: 686088EF78EE4083
10 changed files with 163 additions and 51 deletions

View file

@ -10,15 +10,15 @@ from halig.settings import Settings
@pytest.fixture()
def notes(notebooks_path: Path):
personal = (notebooks_path / "Personal")
work = (notebooks_path / "Work")
personal = notebooks_path / "Personal"
work = notebooks_path / "Work"
personal.mkdir()
work.mkdir()
personal_todos = (personal / "todos.age")
personal_todos = personal / "todos.age"
personal_todos.touch()
work_todos = (work / "todos.age")
work_todos = work / "todos.age"
work_todos.touch()
dailies = work / "Dailies"
@ -47,7 +47,9 @@ def current_note(notes, settings, encryptor) -> Path:
@pytest.fixture
def current_daily(notes, settings, encryptor) -> Path:
note_path = settings.notebooks_root_path / "Work" / "Dailies" / f"{utils.now().date()}.age"
note_path = (
settings.notebooks_root_path / "Work" / "Dailies" / f"{utils.now().date()}.age"
)
data = encryptor.encrypt("foo".encode())
with note_path.open("wb") as f:
f.write(data)
@ -60,4 +62,4 @@ def mock_edit(mocker):
with open(callargs[1], "wb") as f:
f.write("edited".encode())
mocker.patch('halig.commands.edit.subprocess.call', side_effect=edit)
mocker.patch("halig.commands.edit.subprocess.call", side_effect=edit)