1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
"""Tests for the OpenSky Library."""
import pytest
from python_opensky import BoundingBox
from python_opensky.exceptions import OpenSkyCoordinateError
def test_degrees() -> None:
"""Test if validation passes."""
box: BoundingBox = BoundingBox(
min_latitude=0,
max_latitude=0,
min_longitude=0,
max_longitude=0,
)
box.validate()
box = BoundingBox(
min_latitude=-91,
max_latitude=0,
min_longitude=0,
max_longitude=0,
)
with pytest.raises(OpenSkyCoordinateError):
box.validate()
box = BoundingBox(
min_latitude=0,
max_latitude=0,
min_longitude=-181,
max_longitude=0,
)
with pytest.raises(OpenSkyCoordinateError):
box.validate()
|