First working function of map-spawning

This commit is contained in:
Griatch 2021-07-04 18:05:50 +02:00
parent 93e20d05b2
commit 0bca9963fe

View file

@ -346,11 +346,7 @@ class _MapTest(TestCase):
Parent for map tests Parent for map tests
""" """
map_data = { map_data = {'map': MAP1, 'zcoord': "map1"}
'map': MAP1,
'zcoord': "map1",
}
map_display = MAP1_DISPLAY map_display = MAP1_DISPLAY
def setUp(self): def setUp(self):
@ -368,10 +364,6 @@ class TestMap1(_MapTest):
Test the Map class with a simple 4-node map Test the Map class with a simple 4-node map
""" """
# def setUp(self):
# self.map = xymap.XYMap({"map": MAP1}, Z="testmap")
# self.map.parse()
def test_str_output(self): def test_str_output(self):
"""Check the display_map""" """Check the display_map"""
self.assertEqual(str(self.map).strip(), MAP1_DISPLAY) self.assertEqual(str(self.map).strip(), MAP1_DISPLAY)
@ -449,14 +441,13 @@ class TestMap1(_MapTest):
self.assertEqual(expected, mapstr) self.assertEqual(expected, mapstr)
class TestMap2(TestCase): class TestMap2(_MapTest):
""" """
Test with Map2 - a bigger map with multi-step links Test with Map2 - a bigger map with multi-step links
""" """
def setUp(self): map_data = {'map': MAP2, 'zcoord': "map2"}
self.map = xymap.XYMap({"map": MAP2}, Z="testmap") map_display = MAP2_DISPLAY
self.map.parse()
def test_str_output(self): def test_str_output(self):
"""Check the display_map""" """Check the display_map"""
@ -565,9 +556,8 @@ class TestMap3(TestCase):
Test Map3 - Map with diagonal links Test Map3 - Map with diagonal links
""" """
def setUp(self): map_data = {'map': MAP3, 'zcoord': "map3"}
self.map = xymap.XYMap({"map": MAP3}, Z="testmap") map_display = MAP3_DISPLAY
self.map.parse()
def test_str_output(self): def test_str_output(self):
"""Check the display_map""" """Check the display_map"""
@ -610,14 +600,13 @@ class TestMap3(TestCase):
max_size=max_size) max_size=max_size)
self.assertEqual(expected, mapstr) self.assertEqual(expected, mapstr)
class TestMap4(TestCase): class TestMap4(_MapTest):
""" """
Test Map4 - Map with + and x crossing links Test Map4 - Map with + and x crossing links
""" """
def setUp(self): map_data = {'map': MAP4, 'zcoord': "map4"}
self.map = xymap.XYMap({"map": MAP4}, Z="testmap") map_display = MAP4_DISPLAY
self.map.parse()
def test_str_output(self): def test_str_output(self):
"""Check the display_map""" """Check the display_map"""