Exemplo n.º 1
0
    def startElement(self, name, attrs):
        if name == "unit":
            for item in attrs.items():
                if item[0] == "id":

                    self._curr = taxonomy.Unit()
                    self._curr.id = item[1]
        elif name == "xs:enumeration":
            for item in attrs.items():
                if item[0] == "value":
                    self._curr.append(item[1])
Exemplo n.º 2
0
    def startElement(self, name, attrs):
        if name == "unit":
            for item in attrs.items():
                if item[0] == "id":

                    # Temporary fix for the circular dependency issue
                    from oblib import taxonomy

                    self._curr = taxonomy.Unit()
                    self._curr.id = item[1]
        elif name == "xs:enumeration":
            for item in attrs.items():
                if item[0] == "value":
                    self._curr.append(item[1])
Exemplo n.º 3
0
 def test_unit(self):
     self.assertIsInstance(taxonomy.Unit(), taxonomy.Unit)