def test_type_is_common_type(self): xml_schema = self.xml_element_data_handler.get_xsd('common_type') element_root_xpath = '/xs:schema/xs:element' element_root = xml_schema.xpath(element_root_xpath, namespaces=self.namespace)[0] element_type = get_element_type(element_root, xml_schema, 'xsd', '', None) self.assertEqual(element_type, (None, xml_schema, None))
def test_no_type_more_children(self): xml_schema = self.xml_element_data_handler.get_xsd(join('no_type', 'more_children')) element_root_xpath = '/xs:schema/xs:element' element_root = xml_schema.xpath(element_root_xpath, namespaces=self.namespace)[0] element_type = get_element_type(element_root, xml_schema, self.namespace, 'xs', None) self.assertEqual(element_type, (None, xml_schema, None))
def test_type_is_simple_type(self): xml_schema = self.xml_element_data_handler.get_xsd(join('simple_type')) element_root_xpath = '/xs:schema/xs:element' element_root = xml_schema.xpath(element_root_xpath, namespaces=self.namespace)[0] simple_type_xpath = '/xs:schema/xs:simpleType' simple_type = xml_schema.xpath(simple_type_xpath, namespaces=self.namespace)[0] element_type = get_element_type(element_root, xml_schema, self.namespace, 'xs', None) self.assertEqual(element_type, (simple_type, xml_schema, None))