diff --git a/pysyge/pysyge.py b/pysyge/pysyge.py index e12f806..5821ca5 100644 --- a/pysyge/pysyge.py +++ b/pysyge/pysyge.py @@ -146,7 +146,7 @@ def _search_idx(self, ipn: bytes, min_: int, max_: int) -> int: min_ += 1 - if min_ >= max_: + if min_ > max_: break else: diff --git a/tests/test_module.py b/tests/test_module.py index 385f8d2..91d344e 100644 --- a/tests/test_module.py +++ b/tests/test_module.py @@ -27,6 +27,10 @@ def test_quirks(): result = geodata.get_location('109.207.230.244') assert result['city'] == 'Калининград' + geodata = pysyge.GeoLocator(DATABASE_CITY_FILE, pysyge.MODE_BATCH) + result = geodata.get_location('109.252.119.71', detailed=True) + assert result['info']['city']['name_en'] == 'Moscow' + class TestGeoLocatorBasicCheck: