def test_getSimpleModelsRelatedWithChEBI(self): res = self.s.getSimpleModelsRelatedWithChEBI() from bioservices import xmltools res = xmltools.easyXML(res.encode('utf-8')) modelIDs = set( [x.findall('modelId')[0].text for x in res.getchildren()]) assert len(modelIDs) > 1
def easyXML(self, res): """Use this method to convert a XML document into an :class:`~bioservices.xmltools.easyXML` object The easyXML object provides utilities to ease access to the XML tag/attributes. Here is a simple example starting from the following XML .. doctest:: >>> from bioservices import * >>> doc = "<xml> <id>1</id> <id>2</id> </xml>" >>> s = Service("name") >>> res = s.easyXML(doc) >>> res.findAll("id") [<id>1</id>, <id>2</id>] """ from bioservices import xmltools return xmltools.easyXML(res)
def test_getSimpleModelsRelatedWithChEBI(self): res = self.s.getSimpleModelsRelatedWithChEBI() from bioservices import xmltools res = xmltools.easyXML(res.encode('utf-8')) modelIDs = set([x.findall('modelId')[0].text for x in res.getchildren()]) assert len(modelIDs) > 1
def test_easyXML(): res = easyXML(xmldata) res['parameter']
def test_easyXML(): res = easyXML(xmldata) print res res['parameter']