Files
claude-config/bin/do_epic/backend/test_fake.py
T

31 lines
988 B
Python

import pathlib
import sys
import unittest
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[2]))
from do_epic.backend.contract import EpicStoreContract
from failure import Failure
from do_epic.backend.fake import MemoryEpic
class MemoryEpicContract(EpicStoreContract, unittest.TestCase):
def new_store(self) -> MemoryEpic:
return MemoryEpic("ABC-12")
def assign(self, store: MemoryEpic, key: str, name: str) -> None: # type: ignore[override]
store.change(key, assignee=name)
def close(self, store: MemoryEpic, key: str, status: str) -> None: # type: ignore[override]
store.change(key, status=status, done=True)
class Failing(unittest.TestCase):
def test_every_read_and_filing_fails_with_the_reason_given(self) -> None:
store = MemoryEpic("ABC-12", fails="Jira is down")
self.assertEqual((store.read(), store.file("ABC-12", "Count the runs.", "", ())), (Failure("Jira is down"), Failure("Jira is down")))
if __name__ == "__main__":
unittest.main()