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])
def test_unit(self): self.assertIsInstance(taxonomy.Unit(), taxonomy.Unit)