Made north and +Y same direction for map
This commit is contained in:
parent
1081cc21af
commit
0893b7b80b
1 changed files with 51 additions and 2 deletions
|
|
@ -4,9 +4,9 @@ Tests for the Mapsystem
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from unittest import TestCase, mock
|
from unittest import TestCase
|
||||||
from . import mapsystem
|
|
||||||
from parameterized import parameterized
|
from parameterized import parameterized
|
||||||
|
from . import mapsystem
|
||||||
|
|
||||||
|
|
||||||
MAP1 = """
|
MAP1 = """
|
||||||
|
|
@ -20,6 +20,7 @@ MAP1 = """
|
||||||
+ 0 1 2
|
+ 0 1 2
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
MAP1_DISPLAY = """
|
MAP1_DISPLAY = """
|
||||||
#-#
|
#-#
|
||||||
| |
|
| |
|
||||||
|
|
@ -27,6 +28,41 @@ MAP1_DISPLAY = """
|
||||||
""".strip()
|
""".strip()
|
||||||
|
|
||||||
|
|
||||||
|
MAP2 = """
|
||||||
|
|
||||||
|
+ 0 1 2 3 4 5
|
||||||
|
|
||||||
|
5 #-#-#-#-#
|
||||||
|
| |
|
||||||
|
4 #---#
|
||||||
|
| |
|
||||||
|
3 # | #-#
|
||||||
|
| | |
|
||||||
|
2 #-#-#-#---#
|
||||||
|
| |
|
||||||
|
1 #-#-#---#-#
|
||||||
|
| |
|
||||||
|
0 #-#-#-#
|
||||||
|
|
||||||
|
+ 0 1 2 3 4 5
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
MAP2_DISPLAY = """
|
||||||
|
#-#-#-#-#
|
||||||
|
| |
|
||||||
|
#---#
|
||||||
|
| |
|
||||||
|
# | #-#
|
||||||
|
| | |
|
||||||
|
#-#-#-#---#
|
||||||
|
| |
|
||||||
|
#-#-#---#-#
|
||||||
|
| |
|
||||||
|
#-#-#-#
|
||||||
|
""".strip()
|
||||||
|
|
||||||
|
|
||||||
class TestMap1(TestCase):
|
class TestMap1(TestCase):
|
||||||
"""
|
"""
|
||||||
Test the Map class with a simple map and default symbol legend.
|
Test the Map class with a simple map and default symbol legend.
|
||||||
|
|
@ -77,3 +113,16 @@ class TestMap1(TestCase):
|
||||||
lst = self.map.get_map_display(coord, dist=1, return_str=False, character='@')
|
lst = self.map.get_map_display(coord, dist=1, return_str=False, character='@')
|
||||||
self.assertEqual(string, expectstr)
|
self.assertEqual(string, expectstr)
|
||||||
self.assertEqual(lst, expectlst)
|
self.assertEqual(lst, expectlst)
|
||||||
|
|
||||||
|
|
||||||
|
class TestMap2(TestCase):
|
||||||
|
"""
|
||||||
|
Test with Map2 - a bigger map with some links crossing nodes.
|
||||||
|
|
||||||
|
"""
|
||||||
|
def setUp(self):
|
||||||
|
self.map = mapsystem.Map({"map": MAP2})
|
||||||
|
|
||||||
|
def test_str_output(self):
|
||||||
|
"""Check the display_map"""
|
||||||
|
self.assertEqual(str(self.map).strip(), MAP2_DISPLAY)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue