Commit 5b0ab0ec authored by Eric Duminil's avatar Eric Duminil
Browse files

Testing resolution

parent e136c0f2
...@@ -10,6 +10,14 @@ class TestGetCoordinates(unittest.TestCase): ...@@ -10,6 +10,14 @@ class TestGetCoordinates(unittest.TestCase):
self.assertTrue(coords.startswith('POLYGON ((9.')) self.assertTrue(coords.startswith('POLYGON ((9.'))
self.assertTrue(' 48.7' in coords) self.assertTrue(' 48.7' in coords)
self.assertTrue(' 9.15' in coords) self.assertTrue(' 9.15' in coords)
# Should be detailed enough
self.assertTrue(len(coords.split(',')) > 100)
def test_get_single_plz_with_coarser_coordinates(self):
coords = get_coordinates_by_zipcode(['70567'], precision=1000)
self.assertTrue(coords.startswith('POLYGON ((9.'))
# Should be not detailed at all
self.assertTrue(len(coords.split(',')) < 10)
def test_get_multiple_plz(self): def test_get_multiple_plz(self):
# Multiple PLZs # Multiple PLZs
...@@ -36,7 +44,7 @@ class TestGetCoordinates(unittest.TestCase): ...@@ -36,7 +44,7 @@ class TestGetCoordinates(unittest.TestCase):
def test_get_coords_in_clipboard(self): def test_get_coords_in_clipboard(self):
pyperclip.copy("") pyperclip.copy("")
self.assertEquals(pyperclip.paste(), "") self.assertEqual(pyperclip.paste(), "")
get_coordinates_by_zipcode(['70567']) get_coordinates_by_zipcode(['70567'])
coords = pyperclip.paste() coords = pyperclip.paste()
self.assertTrue(coords.startswith('POLYGON ((9.')) self.assertTrue(coords.startswith('POLYGON ((9.'))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment