13 lines
547 B
Markdown
13 lines
547 B
Markdown
# 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`)
|
|
1. Zaimplementuj `InMemoryKvStore` spełniający `KvStore`.
|
|
2. Zaimplementuj `FeatureFlagService.is_enabled(flag: str) -> bool` (zwraca `True`, jeśli wartość w store to `"true"` lub `"1"`, case-insensitive).
|
|
|
|
## Uruchomienie testów
|
|
```bash
|
|
make test MOD=02-engineering-2026/04-testing-best-practices
|
|
```
|