547 B
547 B
04 — Dobre Praktyki Testowania (pytest, In-Memory Fakes)
Zamiast kruchych mocków (MagicMock), w testach jednostkowych stosuj czyste In-Memory Fakes implementujące ten sam kontrakt (Protocol).
Zadania (testing_ex.py)
- Zaimplementuj
InMemoryKvStorespełniającyKvStore. - Zaimplementuj
FeatureFlagService.is_enabled(flag: str) -> bool(zwracaTrue, jeśli wartość w store to"true"lub"1", case-insensitive).
Uruchomienie testów
make test MOD=02-engineering-2026/04-testing-best-practices