Skip to content

Commit 8af94cd

Browse files
committed
Improve coverage for validators
1 parent 360789e commit 8af94cd

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/test_validators.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@
99

1010
class TestValidators(unittest.TestCase):
1111
def test_validate_latitude(self):
12+
# This is quick
13+
for i in range(-89, 91):
14+
validate_latitude(i)
15+
16+
validate_latitude(-89.9)
17+
validate_latitude(-0.1)
18+
validate_latitude(-0.0)
19+
validate_latitude(0.1)
20+
validate_latitude(90.0)
21+
1222
self.assertRaisesRegex(
1323
ValidationError, "invalid latitude", validate_latitude, 91
1424
)
@@ -17,6 +27,16 @@ def test_validate_latitude(self):
1727
)
1828

1929
def test_validate_longitude(self):
30+
# This is quick
31+
for i in range(-179, 181):
32+
validate_longitude(i)
33+
34+
validate_longitude(-179.9)
35+
validate_longitude(-0.1)
36+
validate_longitude(-0.0)
37+
validate_longitude(0.1)
38+
validate_longitude(179.9)
39+
2040
self.assertRaisesRegex(
2141
ValidationError, "invalid longitude", validate_longitude, 181
2242
)

0 commit comments

Comments
 (0)