From 5b0ab0ec34e1dcf64678593a06cf998cfeb9b65a Mon Sep 17 00:00:00 2001
From: Eric Duminil <eric.duminil@gmail.com>
Date: Thu, 4 Jul 2024 14:25:20 +0200
Subject: [PATCH] Testing resolution

---
 test_zipcode.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/test_zipcode.py b/test_zipcode.py
index 189ee2f..cfdc59e 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.'))
-- 
GitLab