def test_m2_string_representation(self): org_name_ref = M2Coordinate(org='org.example', name='lib', rev='the-ref') self.assertEquals('org.example:lib:the-ref::jar', str(org_name_ref)) self.assertEquals(org_name_ref, M2Coordinate.from_string(str(org_name_ref))) org_name_ref_classifier = M2Coordinate(org='org.example', name='lib', rev='the-ref', classifier='classify') self.assertEquals('org.example:lib:the-ref:classify:jar', str(org_name_ref_classifier)) self.assertEquals(org_name_ref_classifier, M2Coordinate.from_string(str(org_name_ref_classifier))) org_name_classifier = M2Coordinate(org='org.example', name='lib', classifier='classify') self.assertEquals('org.example:lib::classify:jar', str(org_name_classifier)) self.assertEquals(org_name_classifier, M2Coordinate.from_string(str(org_name_classifier))) org_name_type_classifier = M2Coordinate(org='org.example', name='lib', classifier='classify', ext='zip') self.assertEquals('org.example:lib::classify:zip', str(org_name_type_classifier)) self.assertEquals(org_name_type_classifier, M2Coordinate.from_string(str(org_name_type_classifier))) org_name_type_jar_classifier = M2Coordinate(org='org.example', name='lib', classifier='classify', ext='jar') self.assertEquals('org.example:lib::classify:jar', str(org_name_type_jar_classifier)) self.assertEquals(org_name_type_jar_classifier, M2Coordinate.from_string(str(org_name_type_jar_classifier)))
def test_m2_string_representation(self): org_name_ref = M2Coordinate(org='org.example', name='lib', rev='the-ref') self.assertEquals('org.example:lib:the-ref::jar', str(org_name_ref)) self.assertEquals(org_name_ref, M2Coordinate.from_string(str(org_name_ref))) org_name_ref_classifier = M2Coordinate(org='org.example', name='lib', rev='the-ref', classifier='classify') self.assertEquals('org.example:lib:the-ref:classify:jar', str(org_name_ref_classifier)) self.assertEquals( org_name_ref_classifier, M2Coordinate.from_string(str(org_name_ref_classifier))) org_name_classifier = M2Coordinate(org='org.example', name='lib', classifier='classify') self.assertEquals('org.example:lib::classify:jar', str(org_name_classifier)) self.assertEquals(org_name_classifier, M2Coordinate.from_string(str(org_name_classifier))) org_name_type_classifier = M2Coordinate(org='org.example', name='lib', classifier='classify', ext='zip') self.assertEquals('org.example:lib::classify:zip', str(org_name_type_classifier)) self.assertEquals( org_name_type_classifier, M2Coordinate.from_string(str(org_name_type_classifier))) org_name_type_jar_classifier = M2Coordinate(org='org.example', name='lib', classifier='classify', ext='jar') self.assertEquals('org.example:lib::classify:jar', str(org_name_type_jar_classifier)) self.assertEquals( org_name_type_jar_classifier, M2Coordinate.from_string(str(org_name_type_jar_classifier)))
def m2_for(c): return M2Coordinate.from_string(c)