Пример #1
0
 def test_gbxml_remove_zone(self):
     g=Gbxml(config.xml,config.xsd)
     g.remove_zone('Zone-DINING_ROOM')
     l=g.elements('Zone')
     check=9
     self.assertEqual(len(l),check)
     space=g.element('DINING_ROOM')[0]
     check=None
     self.assertEqual(space.get('zoneIdRef'),check)
Пример #2
0
 def test_gbxml_add_zone(self):
     g=Gbxml()
     campus=g.add_element(g.root(),'Campus')
     building=g.add_element(campus,'Building')
     space=g.add_element(building,'Space')
     space.set('id','space-1')
     g.add_zone('zone-1','space-1')
     l=g.elements('Zone')
     check=1
     self.assertEqual(len(l),check)
     st=space.get('zoneIdRef')
     check='zone-1'
     self.assertEqual(st,check)
Пример #3
0
 def test_gbxml_remove_element(self):
     g=Gbxml(config.xml,config.xsd)
     g.remove_element('campus-1')
     l=g.elements('Campus')
     check=[]
     self.assertEqual(l,check)
Пример #4
0
 def test_gbxml_add_element(self):
     g=Gbxml()
     g.add_element(g.root(),'Campus')
     n=len(g.elements())
     check=2
     self.assertEqual(n,check)
Пример #5
0
 def test_gbxml_text(self):
     g=Gbxml(config.xml,config.xsd)
     e=g.elements(label='Name')[0]
     st=g.text(e)
     check='detached_house'
     self.assertEqual(st,check)
Пример #6
0
 def test_gbxml_elements(self):
     g=Gbxml(config.xml,config.xsd)
     l=g.elements()
     n=len(l)
     check=2707
     self.assertEqual(n,check)