From fdfcafba0b668fb9c83973f4b82ba2ce970d5cc8 Mon Sep 17 00:00:00 2001 From: Go Wind Date: Mon, 2 Dec 2013 22:33:27 -0500 Subject: [PATCH] Added supported languages from help/languages --- tests/test_api.py | 9 +++++++++ tweepy/api.py | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/tests/test_api.py b/tests/test_api.py index 8e3660e..4c4a6de 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -317,6 +317,15 @@ class TweepyAPITests(TweepyTestCase): self.assertTrue(place_name_in_list('Austin, TX', self.api.reverse_geocode(lat=30.267370168467806, long= -97.74261474609375))) # Austin, TX, USA + def testsupportedlanguages(self): + languages = self.api.supported_languages() + expected_dict = { + "name": "English", + "code": "en", + "status": "production" + } + self.assertTrue(expected_dict in languages) + class TweepyCacheTests(unittest.TestCase): timeout = 2.0 diff --git a/tweepy/api.py b/tweepy/api.py index 22f0819..a1af9b6 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -666,6 +666,13 @@ class API(object): allowed_param = ['lat', 'long', 'name', 'contained_within'] ) + """ help/languages.json """ + supported_languages = bind_api( + path = '/help/languages.json', + payload_type = 'json', + require_auth = True + ) + """ Internal use only """ @staticmethod def _pack_image(filename, max_size, form_field="image"): -- 2.25.1