def test_is_version_specified(self): concept_head = ConceptFactory() concept_v1 = ConceptFactory(parent=concept_head.parent, version='v1', mnemonic=concept_head.mnemonic) self.assertTrue(is_version_specified(concept_v1.uri)) self.assertTrue(is_version_specified(concept_head.uri))
def select_update_message(self, expression): adding_head_version = not is_version_specified(expression) expression_parts = expression.split('/') resource_type = expression_parts[5] if adding_head_version: return self.adding_to_head_message_by_type(resource_type) resource_name = expression_parts[6] return self.version_added_message_by_type(resource_name, self.parent_resource.name, resource_type)