def test_adding_item_to_wrong_section_fails(self): rezume = Rezume() with pytest.raises(RezumeError): item = Education(institution="edX", area="humanity", start_date="2020-07-05") rezume.add_item("work", item)
def test_can_add_item_to_known_section(self): try: rezume = Rezume() section_name = "education" assert len(rezume[section_name]) == 0 item = Education(institution="edX", area="humanity", startDate="2020-07-05") rezume.add_item(section_name, item) assert len(rezume[section_name]) == 1 except Exception: pytest.fail("Exception not expected")
def test_adding_item_to_unknown_section_fails(self): rezume = Rezume() with pytest.raises(RezumeError): rezume.add_item("-work-", Experience.construct())