def test_getTypeDescriptionFeaturesAsString(self): castypesytem = TypeSystemParser() castypesytem.setTypeAsFile('tests/testing_data/typesystem.xml') "print(castypesytem.getTypeDescriptionFeaturesAsString(castypesytem.getTypeDescElements()[1]))" self.assertEqual( castypesytem.getElementTag( castypesytem.getTypeDescriptionFeatures( castypesytem.getTypeDescElements()[1])), '{http://uima.apache.org/resourceSpecifier}features') self.assertEqual( castypesytem.getElementText( castypesytem.getTypeDescriptionFeatures( castypesytem.getTypeDescElements()[1])), '\n ') self.assertEqual( castypesytem.getElementNamespace( castypesytem.getTypeDescriptionFeatures( castypesytem.getTypeDescElements()[1])), 'http://uima.apache.org/resourceSpecifier') self.assertEqual( castypesytem.getElementLocalname( castypesytem.getTypeDescriptionFeatures( castypesytem.getTypeDescElements()[1])), 'features') """ castypesytem1 = TypeSystemParser() atypeDesc= castypesytem.getTypeDescElements()[1] features = castypesytem1.getTypeDescriptionFeatures(atypeDesc) castypesytem2 = TypeSystemParser() """ "print(castypesytem2.getTypeDescriptionFeaturesAsString(atypeDesc))"
def test_getTypeDesc(self): castypesytem = TypeSystemParser() castypesytem.setTypeAsFile('tests/testing_data/typesystem.xml') "print(castypesytem.getTypeDescElements())" "print(castypesytem.getTypeDescElements()[0])" self.assertEqual( castypesytem.getTypeDescElementsAsStingList()[0], '<typeDescription xmlns="http://uima.apache.org/resourceSpecifier"><name>uima.tcas.DocumentAnnotation</name><description/><supertypeName>uima.tcas.Annotation</supertypeName><features><featureDescription><name>language</name><description/><rangeTypeName>uima.cas.String</rangeTypeName></featureDescription></features></typeDescription>' ) self.assertEqual( castypesytem.getElementTag(castypesytem.getTypeDescElements()[0]), '{http://uima.apache.org/resourceSpecifier}typeDescription') self.assertEqual( castypesytem.getElementNamespace( castypesytem.getTypeDescElements()[0]), 'http://uima.apache.org/resourceSpecifier') self.assertEqual( castypesytem.getElementLocalname( castypesytem.getTypeDescElements()[0]), 'typeDescription') self.assertEqual( castypesytem.getElementText(castypesytem.getTypeDescElements()[0]), '\n ')