Exemplo n.º 1
0
 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')
Exemplo n.º 2
0
 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')
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
 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)
Exemplo n.º 5
0
 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)
Exemplo n.º 6
0
 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)
Exemplo n.º 7
0
 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)
Exemplo n.º 8
0
 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)
Exemplo n.º 9
0
 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)
Exemplo n.º 10
0
 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)
Exemplo n.º 11
0
 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)
Exemplo n.º 12
0
 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)
Exemplo n.º 13
0
 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)
Exemplo n.º 14
0
 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)
Exemplo n.º 15
0
 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)
Exemplo n.º 16
0
 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)
Exemplo n.º 17
0
 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)
Exemplo n.º 18
0
 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)
Exemplo n.º 19
0
 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)
Exemplo n.º 20
0
 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)
Exemplo n.º 21
0
 def test_gbxsd___init__(self):
     g = Gbxsd(config.xsd)
     check = isinstance(g, Gbxsd)
     self.assertEqual(True, check)
Exemplo n.º 22
0
 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)
Exemplo n.º 23
0
 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)