def test_tag_id_invalid_character(self): assert_report_item_list_equal( lib._validate_tag_id("tag,id", self.id_provider), [fixture.report_invalid_id("tag,id", ",")], ) assert_report_item_list_equal( lib._validate_tag_id("tagid>", self.id_provider), [fixture.report_invalid_id("tagid>", ">")], ) assert_report_item_list_equal( lib._validate_tag_id("taígid", self.id_provider), [fixture.report_invalid_id("taígid", "í")], )
def test_tag_id_invalid_first_character(self): assert_report_item_list_equal( lib._validate_tag_id("0tagid", self.id_provider), [fixture.report_invalid_id("0tagid", "0")], ) assert_report_item_list_equal( lib._validate_tag_id("-tagid", self.id_provider), [fixture.report_invalid_id("-tagid", "-")], ) assert_report_item_list_equal( lib._validate_tag_id("átagid", self.id_provider), [fixture.report_invalid_id("átagid", "á")], )
def test_tag_id_is_empty(self): assert_report_item_list_equal( lib._validate_tag_id("", self.id_provider), [ fixture.error( reports.codes.INVALID_ID_IS_EMPTY, id_description="id", ) ], )
def test_tag_id_already_exists(self): for tag_id in ["id-01", "id-02"]: assert_report_item_list_equal( lib._validate_tag_id(tag_id, self.id_provider), [fixture.error(reports.codes.ID_ALREADY_EXISTS, id=tag_id)], )
def test_tag_id_is_valid(self): assert_report_item_list_equal( lib._validate_tag_id("new-tag-id", self.id_provider), [], )