ci: add pre-commit and tests workflows
This commit is contained in:
parent
ee43046e59
commit
bdb5c984fa
13 changed files with 339 additions and 297 deletions
|
|
@ -1,6 +1,5 @@
|
|||
from pathlib import Path
|
||||
|
||||
import pendulum
|
||||
import pytest as pytest
|
||||
|
||||
from halig import utils
|
||||
|
|
@ -24,10 +23,10 @@ def notes(notebooks_path: Path):
|
|||
dailies = work / "Dailies"
|
||||
dailies.mkdir()
|
||||
|
||||
dt = pendulum.now()
|
||||
dt = utils.now()
|
||||
for day_offset in range(10):
|
||||
dt = dt.subtract(days=day_offset)
|
||||
(dailies / f"{dt.date()}.age").touch()
|
||||
dt = dt.subtract(hours=day_offset*24)
|
||||
(dailies / f"{dt.py_datetime().date()}.age").touch()
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
|
|
@ -56,7 +55,7 @@ def notebooks_command(settings: Settings):
|
|||
|
||||
@pytest.fixture()
|
||||
def current_note(notes, settings, encryptor) -> Path:
|
||||
note_path = settings.notebooks_root_path / f"{utils.now().date()}.age"
|
||||
note_path = settings.notebooks_root_path / f"{utils.now_as_date()}.age"
|
||||
note_path.touch()
|
||||
data = encryptor.encrypt(b"foo")
|
||||
with note_path.open("wb") as f:
|
||||
|
|
@ -67,7 +66,7 @@ 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"
|
||||
settings.notebooks_root_path / "Work" / "Dailies" / f"{utils.now_as_date()}.age"
|
||||
)
|
||||
data = encryptor.encrypt(b"foo")
|
||||
with note_path.open("wb") as f:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue