Bopytex/test/test_bopytex.py

30 lines
824 B
Python

from bopytex.bopytex import build_subject_list_from_infos, build_subject_list_from_qty
def test_build_subject_list_from_qty():
subjects = build_subject_list_from_qty(10)
assert subjects == [
{"number": "01"},
{"number": "02"},
{"number": "03"},
{"number": "04"},
{"number": "05"},
{"number": "06"},
{"number": "07"},
{"number": "08"},
{"number": "09"},
{"number": "10"},
]
def test_build_subject_list_from_infos():
infos = [
{"name": "test1", "date": "today"},
{"name": "test2", "date": "tomorow"},
]
subjects = build_subject_list_from_infos(infos)
assert subjects == [
{"name": "test1", "date": "today", "number": "1"},
{"name": "test2", "date": "tomorow", "number": "2"},
]