tanszek:oktatas:informacios_rendszerek_integralasa:tdd_pelda
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tanszek:oktatas:informacios_rendszerek_integralasa:tdd_pelda [2024/02/25 22:30] – [Teszt írása] knehez | tanszek:oktatas:informacios_rendszerek_integralasa:tdd_pelda [2024/02/25 22:32] (current) – [Teszt írása] knehez | ||
---|---|---|---|
Line 54: | Line 54: | ||
{{: | {{: | ||
+ | A test_data_formatter.py tartalma legyen: | ||
+ | |||
+ | <sxh python> | ||
+ | from app.data_formatter import format_data_for_display | ||
+ | def test_format_data_for_display(): | ||
+ | people = [ | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | ] | ||
+ | |||
+ | assert format_data_for_display(people) == [ | ||
+ | " | ||
+ | "John Smith: Project Manager", | ||
+ | ] | ||
+ | </ | ||
+ | |||
+ | A data_formatter.py-ben megírjuk az implementációt: | ||
+ | <sxh python> | ||
+ | def format_data_for_display(people): | ||
+ | return [f" | ||
+ | </ | ||
+ | |||
+ | Futtassuk a tesztet: | ||
+ | python -m pytest tests |
tanszek/oktatas/informacios_rendszerek_integralasa/tdd_pelda.1708900217.txt.gz · Last modified: 2024/02/25 22:30 by knehez