def test_correct_object_do_not_raises_exception(self) -> None: correct_change_dict = { 'cmd': 'edit_collection_property', 'new_value': 'arbitary_new_value', 'old_value': '', 'property_name': 'title' } domain_objects_validator.validate_collection_change( correct_change_dict)
def test_incorrect_object_raises_exception(self) -> None: incorrect_change_dict = { 'old_value': '', 'property_name': 'title', 'new_value': 'newValue' } with self.assertRaisesRegex( # type: ignore[no-untyped-call] Exception, 'Missing cmd key in change dict'): domain_objects_validator.validate_collection_change( incorrect_change_dict)