This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from agentci.engine import _sqlite
|
||||
from agentci.engine.repository import Repository
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
async def engine_repository(tmp_path: Path) -> Repository:
|
||||
repository = Repository(tmp_path / "state.sqlite3")
|
||||
await repository.initialize()
|
||||
return repository
|
||||
|
||||
|
||||
@dataclass
|
||||
class SQLiteClock:
|
||||
now: str = "2026-02-01T00:00:00+00:00"
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def sqlite_clock(monkeypatch: pytest.MonkeyPatch) -> SQLiteClock:
|
||||
clock = SQLiteClock()
|
||||
monkeypatch.setattr(_sqlite, "now", lambda: clock.now)
|
||||
return clock
|
||||
Reference in New Issue
Block a user