def test__simpleType(self): g=Gbxsd(config.xsd) s=g._simpleType('absorptanceUnitEnum') check=isinstance(s,etree._Element) self.assertEqual(True,check) with self.assertRaises(KeyError): s=g._simpleType('namedoesnotexist')
def test__simpleType(self): g = Gbxsd(config.xsd) s = g._simpleType('absorptanceUnitEnum') check = isinstance(s, etree._Element) self.assertEqual(True, check) with self.assertRaises(KeyError): s = g._simpleType('namedoesnotexist')
def test_element_attributes_exist(self): g = Gbxsd(config.xsd) b = g.element_attributes_exist('gbXML') check = True self.assertEqual(b, check) b = g.element_attributes_exist('AirChangesPerHour') check = False self.assertEqual(b, check)
def test_element_names(self): g = Gbxsd(config.xsd) l = g.element_names() check = [ 'gbXML', 'aecXML', 'Absorptance', 'AdjacentSpaceId', 'Age', 'AirChangesPerHour' ] self.assertEqual(l[:6], check)
def test_element_attributes_exist(self): g=Gbxsd(config.xsd) b=g.element_attributes_exist('gbXML') check=True self.assertEqual(b,check) b=g.element_attributes_exist('AirChangesPerHour') check=False self.assertEqual(b,check)
def test_element_children_exist(self): g=Gbxsd(config.xsd) b=g.element_children_exist('gbXML') check=True self.assertEqual(b,check) b=g.element_children_exist('Age') check=False self.assertEqual(b,check)
def test_element_children_exist(self): g = Gbxsd(config.xsd) b = g.element_children_exist('gbXML') check = True self.assertEqual(b, check) b = g.element_children_exist('Age') check = False self.assertEqual(b, check)
def test_attribute_restriction_values(self): g=Gbxsd(config.xsd) l=g.attribute_restriction_values('Absorptance','type') check=['IntIR', 'IntSolar', 'IntVisible', 'IntTotal', 'ExtIR', 'ExtSolar', 'ExtVisible', 'ExtTotal'] self.assertEqual(l,check) l=g.attribute_restriction_values('AdjacentSpaceId','spaceIdRef') check=[] self.assertEqual(l,check)
def test_attribute_restriction_values(self): g = Gbxsd(config.xsd) l = g.attribute_restriction_values('Absorptance', 'type') check = [ 'IntIR', 'IntSolar', 'IntVisible', 'IntTotal', 'ExtIR', 'ExtSolar', 'ExtVisible', 'ExtTotal' ] self.assertEqual(l, check) l = g.attribute_restriction_values('AdjacentSpaceId', 'spaceIdRef') check = [] self.assertEqual(l, check)
def test_attribute_restrictions_exist(self): g = Gbxsd(config.xsd) b = g.attribute_restrictions_exist('Absorptance', 'type') self.assertEqual(b, True) b = g.attribute_restrictions_exist('AdjacentSpaceId', 'spaceIdRef') self.assertEqual(b, False)
def test_element_children_specification(self): g=Gbxsd(config.xsd) l=g.element_children_specification('gbXML') check=[{'tag': 'choice', 'minOccurs': '0', 'maxOccurs': 'unbounded'}] self.assertEqual(l,check)
def test_element_children_properties(self): g=Gbxsd(config.xsd) l=g.element_children_properties('gbXML') check=[{'ref': 'aecXML', 'minOccurs': '0'}, {'ref': 'Campus'}] self.assertEqual(l[:2],check)
def test_element_attributes_properties(self): g=Gbxsd(config.xsd) l=g.element_attributes_properties('gbXML') check=[{'name': 'id', 'type': 'xsd:ID'}, {'name': 'engine'}] self.assertEqual(l[:2],check)
def test__node_children_dict(self): g = Gbxsd(config.xsd) d = g._node_children_dict('') with open('node_children_dict.json', 'w') as f: json.dump(d, f, indent=4, sort_keys=True)
def test_element_names(self): g=Gbxsd(config.xsd) l=g.element_names() check=['gbXML', 'aecXML', 'Absorptance', 'AdjacentSpaceId', 'Age', 'AirChangesPerHour'] self.assertEqual(l[:6],check)
def test__simpleType_exists(self): g = Gbxsd(config.xsd) b = g._simpleType_exists('absorptanceUnitEnum') self.assertEqual(b, True) b = g._simpleType_exists('namedoesnotexist') self.assertEqual(b, False)
def test_element_attributes_properties(self): g = Gbxsd(config.xsd) l = g.element_attributes_properties('gbXML') check = [{'name': 'id', 'type': 'xsd:ID'}, {'name': 'engine'}] self.assertEqual(l[:2], check)
def test__simpleType_exists(self): g=Gbxsd(config.xsd) b=g._simpleType_exists('absorptanceUnitEnum') self.assertEqual(b,True) b=g._simpleType_exists('namedoesnotexist') self.assertEqual(b,False)
def test__node_children_dict(self): g=Gbxsd(config.xsd) d=g._node_children_dict('') with open('node_children_dict.json','w') as f: json.dump(d,f,indent=4,sort_keys=True)
def test_attribute_restrictions_exist(self): g=Gbxsd(config.xsd) b=g.attribute_restrictions_exist('Absorptance','type') self.assertEqual(b,True) b=g.attribute_restrictions_exist('AdjacentSpaceId','spaceIdRef') self.assertEqual(b,False)
def test_gbxsd___init__(self): g = Gbxsd(config.xsd) check = isinstance(g, Gbxsd) self.assertEqual(True, check)
def test_element_children_properties(self): g = Gbxsd(config.xsd) l = g.element_children_properties('gbXML') check = [{'ref': 'aecXML', 'minOccurs': '0'}, {'ref': 'Campus'}] self.assertEqual(l[:2], check)
def test_element_children_specification(self): g = Gbxsd(config.xsd) l = g.element_children_specification('gbXML') check = [{'tag': 'choice', 'minOccurs': '0', 'maxOccurs': 'unbounded'}] self.assertEqual(l, check)