def test_ComputeSquareArea(self):
     finder = BaseGeoFinder(1, 1)
     self.assertEquals(finder.compute_square_area(STATION_AROUND_RADIUS),
                       ((0.98922021659056569, 1.0, 1.0107797834094343),
                        (0.98922021659056569, 1.0, 1.0107797834094343)))
     finder.lat = '1'
     finder.lng = '1'
     self.assertEquals(finder.compute_square_area(STATION_AROUND_RADIUS),
                       ((0.98922021659056569, 1.0, 1.0107797834094343),
                        (0.98922021659056569, 1.0, 1.0107797834094343)))
     finder.lat = 4.897645
     finder.lng = 18.798923
     self.assertEquals(finder.compute_square_area(STATION_AROUND_RADIUS),
                       ((4.8868652165905653,
                         4.8976449999999998,
                         4.9084247834094343),
                        (18.788143216590566,
                         18.798922999999998,
                         18.809702783409431)))
    def test_GetStationsAround(self):
        Cartography.synchronize(TEST_XML_URL_DATA_STATION)

        finder = BaseGeoFinder(1, 1)
        self.assertEquals(len(finder.get_stations_around(
            STATION_AROUND_RADIUS)), 0)

        finder.lat = 48.81
        finder.lng = 2.38
        self.assertEquals(
            [station.id for station in
             finder.get_stations_around(STATION_AROUND_RADIUS)],
            [42012, 42010, 42009, 42008, 42016, 42006, 42007, 42015])

        Cartography.flush()