Replace API.geo_id id allowed_param with place_id parameter
authorHarmon <Harmon758@gmail.com>
Fri, 29 Jan 2021 02:33:36 +0000 (20:33 -0600)
committerHarmon <Harmon758@gmail.com>
Fri, 29 Jan 2021 02:34:13 +0000 (20:34 -0600)
tests/test_api.py
tweepy/api.py

index b4abb16a30b412d00b5e12c6dea9375e0bc79039..a0e8eda7217e4610d279a1e53c65db9f96945b8f 100644 (file)
@@ -372,7 +372,7 @@ class TweepyAPITests(TweepyTestCase):
             return any(x.full_name.lower() == place_name.lower() for x in place_list)
 
         # Test various API functions using Austin, TX, USA
-        self.assertEqual(self.api.geo_id(id='1ffd3558f2e98349').full_name, 'Dogpatch, San Francisco')
+        self.assertEqual(self.api.geo_id(place_id='1ffd3558f2e98349').full_name, 'Dogpatch, San Francisco')
         self.assertTrue(place_name_in_list('Austin, TX',
             self.api.reverse_geocode(lat=30.2673701685, long= -97.7426147461)))  # Austin, TX, USA
 
index e958d811c8b4a2c817475d7e4570cc041ccce6b2..1649d41519a4a835d176952f6d2b3ad99e702abf 100644 (file)
@@ -1253,15 +1253,14 @@ class API:
                            'max_results'], **kwargs
         )
 
-    def geo_id(self, *args, **kwargs):
+    def geo_id(self, place_id, *args, **kwargs):
         """ :reference: https://developer.twitter.com/en/docs/geo/place-information/api-reference/get-geo-id-place_id
-            :allowed_param: 'id'
+            :allowed_param:
         """
         return bind_api(
             *args, api=self,
-            path='/geo/id/{id}.json',
-            payload_type='place',
-            allowed_param=['id'], **kwargs
+            path=f'/geo/id/{place_id}.json',
+            payload_type='place', **kwargs
         )
 
     def geo_search(self, *args, **kwargs):