def test_duplicated_id_with_diff_versioning(): validator = IDSetValidator(is_circle=False, is_test_run=True, configuration=CONFIG) obj_data = {"test": {"name": "test", "fromversion": "1.0.0"}} actual_obj_set = {"test": {"name": "test", "toversion": "2.0.0"}} obj_set = [ actual_obj_set, ] validator.id_set = {"testing_set": obj_set} assert validator.is_id_duplicated(obj_id="test", obj_data=obj_data, obj_type="testing_set"), \ "The id validator couldn't find id as duplicated one(In different sets)"
def test_duplicated_id_same_set(): validator = IDSetValidator(configuration=CONFIG, is_test_run=True) obj_data = {"test": {"name": "test"}} actual_obj_set = { "test": { "name": "test", } } obj_set = [ actual_obj_set, ] validator.id_set = {"testing_set": obj_set} assert validator.is_id_duplicated(obj_id="test", obj_data=obj_data, obj_type="testing_set") is False, \ "The id validator found the id as duplicated although it is not"