def test_valid_case_insensitive(self, item): val = EnumValidator(["this", "That"], WARNINGS['W003'], case_insensitive=True) result = val(item) print(result) assert result == []
def test_numbers_bad(self, item): val = EnumValidator([3, 5, 7], "Number: {} not one of {}") result = val(item) print(result) assert len(result) == 1 assert result[0].startswith('Number:') assert str(item) in result[0]
def test_invalid_case_insensitive(self, item, expected): print(expected) val = EnumValidator(["this", "That", "the other"], "item: {}, the list: {}", case_insensitive=True) result = val(item) print(result) assert "item" in result[0]
def test_invalid(self, item, expected): print(expected) val = EnumValidator(["this", "That", "the other"], "item: {}, the list: {}") result = val(item) print(result) assert "item" in result[0] assert "['That', 'the other', 'this']" in result[0]
def test_numbers_good(self): val = EnumValidator([3, 5, 7], "Number: {} not one of {}") result = val(5) assert result == []
def test_valid(self, item): val = EnumValidator(["this", "That"], WARNINGS['W003']) assert val(item) == []
def test_init(self): _val = EnumValidator(["this", "That"], "W003") assert True