def test_reverse_geocoding_of_nothing(): try: geodata.regions_xy(-30.0, -30.0, 'city') except ValueError as e: assert str(e).startswith( 'No objects were found for [-30.000000, -30.000000].\n') return assert False, 'Should fail with nothing found exceptuion'
def test_reverse_geocoding_of_list_(lons, lats): r = geodata.regions_xy(lons, lats, 'city') assert_row(r.to_data_frame(), index=0, request='[-71.057083, 42.361145]', found_name='Boston') assert_row(r.to_data_frame(), index=1, request='[-73.935242, 40.730610]', found_name='New York City')
def test_only_one_sevastopol(): sevastopol = geodata.regions_xy(SEVASTOPOL_LON, SEVASTOPOL_LAT, 'city') assert_row(sevastopol.to_data_frame(), id=SEVASTOPOL_ID)
def test_reverse_geocoding_of_nyc(): r = geodata.regions_xy(NYC_LON, NYC_LAT, 'city') assert_row(r.to_data_frame(), found_name='New York City')
def test_reverse_moscow(level, expected_name): r = geodata.regions_xy(lon=MOSCOW_LON, lat=MOSCOW_LAT, level=level) assert_row(r.to_data_frame(), found_name=expected_name)