Example #1
0
 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
Example #2
0
 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)
Example #3
0
    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)
Example #4
0
 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
Example #5
0
def test_easyXML():
    res = easyXML(xmldata)
    res['parameter']
Example #6
0
def test_easyXML():
    res = easyXML(xmldata)
    print res
    res['parameter']
Example #7
0
def test_easyXML():
    res = easyXML(xmldata)
    res['parameter']
Example #8
0
def test_easyXML():
    res = easyXML(xmldata)
    print res
    res['parameter']