MIL-002 NATO converter: modelling, converter code, tests and Doxygen comments
User story, use case and SSD for "spell a word"; spell_word with try/except KeyError, generate_phonetic with the retry loop, console and CSV adapters, 49 pytest tests; MIL-002 and the modelling documents accepted with review records. Task: MIL-002#1 Task: MIL-002#2 Task: MIL-002#3 Task: MIL-002#4 Task: MIL-002#5 Task: MIL-002#6
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
from pathlib import Path
|
||||
|
||||
from nato_phonetic_alphabet.adapters.csv_alphabet import load_nato_dict
|
||||
|
||||
EXPECTED_ENTRIES = 26
|
||||
|
||||
|
||||
def test_load_nato_dict_reads_temporary_csv(tmp_path: Path) -> None:
|
||||
data_file = tmp_path / "alphabet.csv"
|
||||
data_file.write_text("letter,code\na,Alfa\nB,Bravo\n", encoding="utf-8")
|
||||
|
||||
assert load_nato_dict(data_file) == {"A": "Alfa", "B": "Bravo"}
|
||||
|
||||
|
||||
def test_load_nato_dict_builds_all_entries_from_packaged_file() -> None:
|
||||
alphabet = load_nato_dict()
|
||||
|
||||
assert len(alphabet) == EXPECTED_ENTRIES
|
||||
assert alphabet["Z"] == "Zulu"
|
||||
Reference in New Issue
Block a user