Add one more boundary box test.

This commit is contained in:
Sergey Vartanov 2021-08-07 23:47:23 +03:00
parent db3316d364
commit 43f46035a4
2 changed files with 10 additions and 7 deletions

View file

@ -188,12 +188,9 @@ class Tile:
self.x + 1, self.y + 1, self.scale
).get_coordinates()
lat_2 = point_1[0]
lon_1 = point_1[1]
lat_1 = point_2[0]
lon_2 = point_2[1]
return BoundaryBox(lon_1, lat_1, lon_2, lat_2).round()
return BoundaryBox(
point_1[1], point_2[0], point_2[1], point_1[0]
).round()
def load_map(self, cache_path: Path) -> Map:
"""

View file

@ -7,7 +7,13 @@ __author__ = "Sergey Vartanov"
__email__ = "me@enzet.ru"
def test_extend() -> None:
def test_round_zero_coordinates() -> None:
box: BoundaryBox = BoundaryBox(0, 0, 0, 0).round()
assert box.get_format() == "-0.001,-0.001,0.001,0.001"
def test_round_coordinates() -> None:
box: BoundaryBox = BoundaryBox(
10.067596435546875,
46.094186149226466,