comparison tests/extension_tests/loaders_tests.py @ 0:4a0efb7baf70

* Datasets becomes the new trunk and retires after that :-)
author mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
date Sun, 29 Jun 2008 18:44:17 +0000
parents
children 81641655bc38
comparison
equal deleted inserted replaced
-1:000000000000 0:4a0efb7baf70
1 #!/usr/bin/env python
2 from extension_test_utils import *
3 from loaders import *
4
5 class TestLoaders(unittest.TestCase):
6
7 def setUp(self):
8 self.engine = getEngine()
9 self.model = self.engine.getModel()
10 self.metamodel = self.model.getMetaModel()
11
12 def tearDown(self):
13 del self.engine
14
15 def testLoading(self):
16 loadMapFile("content/maps/new_official_map.xml", self.engine)
17
18 query = self.metamodel.getObjects("id", "15001")
19 self.assertEqual(len(query), 1)
20
21 query = self.metamodel.getObjects("id", "15201")
22 self.assertEqual(len(query), 1)
23
24 query = self.model.getMaps("id", "OfficialMap")
25 self.assertEqual(len(query), 1)
26 self.map = query[0]
27
28 # self.assertEqual(self.map.get("Name"), "official_map.xml")
29 self.assertEqual(self.map.get("Version"), '1')
30 self.assertEqual(self.map.get("Author"), "barra")
31
32 query = self.map.getElevations("id", "OfficialMapElevation")
33 self.assertEqual(len(query), 1)
34 self.elevation = query[0]
35
36 query = self.elevation.getLayers("id", "OfficialMapTileLayer")
37 self.assertEqual(len(query), 1)
38 self.layer = query[0]
39
40 self.assertEqual(self.layer.hasInstances(), True)
41
42 instances = self.layer.getInstances()
43
44
45 # removed from test set now due to switch to new directory structure -> content moved to clients
46 # to be considered if this should be taken into use again
47 TEST_CLASSES = []
48
49 if __name__ == '__main__':
50 unittest.main()