44import unittest
55from geolocation .google_maps import GoogleMaps
66
7- TEST_API_KEY = 'AIzaSyBm0PtaxCuo7iy1KVAnKrl7h8dtA61DXz8'
7+
8+ TEST_API_KEY = 'AIzaSyDNvdrZ_HEtfsuPYHV9UvZGc41BSFBolOM' ,
89
910
1011class GeolocationTest (unittest .TestCase ):
1112 def setUp (self ):
1213 self .google_maps = GoogleMaps (api_key = TEST_API_KEY )
1314
1415 def test_query (self ):
15- address = "New York City Wall Street 12 "
16+ address = "New York City Wall Street 15 "
1617
1718 location = self .google_maps .search (address )
1819
1920 self .assertIsNotNone (location .all ())
2021
2122 def test_city (self ):
22- address = "New York City Wall Street 12 "
23+ address = "New York City Wall Street 14 "
2324
2425 location = self .google_maps .search (address )
2526
@@ -37,7 +38,7 @@ def test_route(self):
3738 self .assertEqual ('Wall Street' , my_location .route .decode ('utf-8' ))
3839
3940 def test_country (self ):
40- address = "New York City Wall Street 12 "
41+ address = "New York City Wall Street 110 "
4142
4243 location = self .google_maps .search (address )
4344
@@ -46,7 +47,7 @@ def test_country(self):
4647 self .assertEqual ('United States' , my_location .country .decode ('utf-8' ))
4748
4849 def test_country_shortcut (self ):
49- address = "New York City Wall Street 12 "
50+ address = "New York City Wall Street 2 "
5051
5152 location = self .google_maps .search (address )
5253
@@ -55,35 +56,35 @@ def test_country_shortcut(self):
5556 self .assertEqual ('US' , my_location .country_shortcut .decode ('utf-8' ))
5657
5758 def test_lat (self ):
58- address = "New York City Wall Street 12 "
59+ address = "New York City Wall Street 1 "
5960
6061 location = self .google_maps .search (address )
6162
6263 my_location = location .first ()
6364
64- self .assertEqual (40.7060008 , my_location .lat )
65+ self .assertEqual (40.707222 , my_location .lat )
6566
6667 def test_lng (self ):
67- address = "New York City Wall Street 12 "
68+ address = "New York City Wall Street 19 "
6869
6970 location = self .google_maps .search (address )
7071
7172 my_location = location .first ()
7273
73- self .assertEqual (- 74.0088189 , my_location .lng )
74+ self .assertEqual (- 74.0134436 , my_location .lng )
7475
7576 def test_formatted_address (self ):
76- address = "New York City Wall Street 12 "
77+ address = "New York City Wall Street 124 "
7778
7879 location = self .google_maps .search (address )
7980
8081 my_location = location .first ()
8182
82- self .assertEqual ('Wall Street, New York, NY, USA' ,
83+ self .assertEqual ('Charging Bull, Broadway, New York, NY 10004 , USA' ,
8384 my_location .formatted_address )
8485
8586 def test_administrative_area_level_1 (self ):
86- address = "New York City Wall Street 12 "
87+ address = "New York City Wall Street 125 "
8788
8889 location = self .google_maps .search (address )
8990
@@ -94,7 +95,7 @@ def test_administrative_area_level_1(self):
9495 my_location .administrative_area [0 ].name .decode ('utf-8' ))
9596
9697 def test_administrative_area_level_2 (self ):
97- address = "New York City Wall Street 12 "
98+ address = "New York City Wall Street 126 "
9899
99100 location = self .google_maps .search (address )
100101
@@ -112,8 +113,8 @@ def test_coding(self):
112113 self .assertEqual (u"São Paulo" , my_location .city .decode ('utf-8' ))
113114
114115 def test_latlng (self ):
115- lat = 37.42291810
116- lng = - 122.08542120
116+ lat = 37.4229210
117+ lng = - 122.0852112
117118
118119 my_location = self .google_maps .search (lat = lat , lng = lng ).first ()
119120
0 commit comments