diff --git a/test_zipcode.py b/test_zipcode.py index 189ee2f82b65b09b3771a44de934b99f0d66dd0e..cfdc59eaf353ed2e825eb7d9496d4e3ad127d7ad 100644 --- a/test_zipcode.py +++ b/test_zipcode.py @@ -10,6 +10,14 @@ class TestGetCoordinates(unittest.TestCase): self.assertTrue(coords.startswith('POLYGON ((9.')) self.assertTrue(' 48.7' 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): # Multiple PLZs @@ -36,7 +44,7 @@ class TestGetCoordinates(unittest.TestCase): def test_get_coords_in_clipboard(self): pyperclip.copy("") - self.assertEquals(pyperclip.paste(), "") + self.assertEqual(pyperclip.paste(), "") get_coordinates_by_zipcode(['70567']) coords = pyperclip.paste() self.assertTrue(coords.startswith('POLYGON ((9.'))