예제 #1
0
    def test_geonames(self):

        geonames = GeoNamesApi(self.license_keys)
        self.assertIsNotNone(geonames)

        latlng = geonames.get_latlong_for_postcode('KY39UR')
        self.assertIsNotNone(latlng)
        self.assertEqual(latlng.latitude, 56.07206267570594)
        self.assertEqual(latlng.longitude, -3.175233048730664)
예제 #2
0
    def test_geonames(self):

        geonames = GeoNamesApi(self.license_keys)
        self.assertIsNotNone(geonames)

        latlng = geonames.get_latlong_for_postcode('KY39UR')
        self.assertIsNotNone(latlng)
        self.assertEquals(latlng.latitude, 56.07206267570594)
        self.assertEquals(latlng.longitude, -3.175233048730664)
예제 #3
0
    def test_geonames(self):
        client = TestClient()
        client.add_license_keys_store()

        geonames = GeoNamesApi(client.license_keys)
        self.assertIsNotNone(geonames)

        GeoNamesApi.get_latlong_for_postcode_response_file = os.path.dirname(__file__)+ os.sep + "geonames_latlong.json"

        latlng = geonames.get_latlong_for_postcode('KY39UR')
        self.assertIsNotNone(latlng)
        self.assertEqual(latlng.latitude, 56.07206267570594)
        self.assertEqual(latlng.longitude, -3.175233048730664)
예제 #4
0
    def test_geonames(self):

        license_keys = LicenseKeys()
        license_keys.load_license_key_file(os.path.dirname(__file__)+"/test.keys")

        geonames = GeoNamesApi(license_keys)
        self.assertIsNotNone(geonames)

        GeoNamesApi.get_latlong_for_postcode_response_file = os.path.dirname(__file__)+"/postcode.json"

        latlng = geonames.get_latlong_for_postcode('KY39UR')
        self.assertIsNotNone(latlng)
        self.assertEquals(latlng.latitude, 56.07206267570594)
        self.assertEquals(latlng.longitude, -3.175233048730664)
예제 #5
0
    def test_geonames(self):

        license_keys = LicenseKeys()
        license_keys.load_license_key_file(os.path.dirname(__file__)+ os.sep + "test.keys")

        geonames = GeoNamesApi(license_keys)
        self.assertIsNotNone(geonames)

        GeoNamesApi.get_latlong_for_postcode_response_file = os.path.dirname(__file__)+ os.sep + "geonames_latlong.json"

        latlng = geonames.get_latlong_for_postcode('KY39UR')
        self.assertIsNotNone(latlng)
        self.assertEquals(latlng.latitude, 56.07206267570594)
        self.assertEquals(latlng.longitude, -3.175233048730664)