Auth test, updating func names and tests that failed
Coverage 56%
This commit is contained in:
parent
6841e7ef28
commit
d3e17dcd4b
2 changed files with 17 additions and 6 deletions
|
|
@ -13,7 +13,7 @@ env:
|
||||||
PROTECTED_TWITTER_2='TwythonSecure2'
|
PROTECTED_TWITTER_2='TwythonSecure2'
|
||||||
TEST_TWEET_ID='332992304010899457'
|
TEST_TWEET_ID='332992304010899457'
|
||||||
TEST_LIST_ID='574'
|
TEST_LIST_ID='574'
|
||||||
script: nosetests -v test_twython:TwythonAPITestCase --cover-package="twython" --with-coverage
|
script: nosetests -v test_twython:TwythonAPITestCase test_twython:TwythonAuthTestCase --cover-package="twython" --with-coverage
|
||||||
install:
|
install:
|
||||||
- pip install -r requirements.txt
|
- pip install -r requirements.txt
|
||||||
notifications:
|
notifications:
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,17 @@ test_tweet_id = os.environ.get('TEST_TWEET_ID', '318577428610031617')
|
||||||
test_list_id = os.environ.get('TEST_LIST_ID', '574') # 574 is @twitter/team
|
test_list_id = os.environ.get('TEST_LIST_ID', '574') # 574 is @twitter/team
|
||||||
|
|
||||||
|
|
||||||
|
class TwythonAuthTestCase(unittest.TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
self.api = Twython(app_key, app_secret)
|
||||||
|
|
||||||
|
def test_get_authentication_tokens(self):
|
||||||
|
'''Test getting authentication tokens works'''
|
||||||
|
self.api.get_authentication_tokens(callback_url='http://google.com/',
|
||||||
|
force_login=True,
|
||||||
|
screen_name=screen_name)
|
||||||
|
|
||||||
|
|
||||||
class TwythonAPITestCase(unittest.TestCase):
|
class TwythonAPITestCase(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.api = Twython(app_key, app_secret,
|
self.api = Twython(app_key, app_secret,
|
||||||
|
|
@ -290,7 +301,7 @@ class TwythonAPITestCase(unittest.TestCase):
|
||||||
def test_get_list_statuses(self):
|
def test_get_list_statuses(self):
|
||||||
'''Test timeline of tweets authored by members of the
|
'''Test timeline of tweets authored by members of the
|
||||||
specified list succeeds'''
|
specified list succeeds'''
|
||||||
self.api.get_list_statuses(id=test_list_id)
|
self.api.get_list_statuses(list_id=test_list_id)
|
||||||
|
|
||||||
def test_create_update_destroy_list_add_remove_list_members(self):
|
def test_create_update_destroy_list_add_remove_list_members(self):
|
||||||
'''Test create a list, adding and removing members then
|
'''Test create a list, adding and removing members then
|
||||||
|
|
@ -344,11 +355,11 @@ class TwythonAPITestCase(unittest.TestCase):
|
||||||
def test_get_list_subscriptions(self):
|
def test_get_list_subscriptions(self):
|
||||||
'''Test collection of the lists the specified user is
|
'''Test collection of the lists the specified user is
|
||||||
subscribed to succeeds'''
|
subscribed to succeeds'''
|
||||||
self.api.get_specific_list(screen_name='twitter')
|
self.api.get_list_subscriptions(screen_name='twitter')
|
||||||
|
|
||||||
def test_show_owned_lists(self):
|
def test_show_owned_lists(self):
|
||||||
'''Test collection of lists the specified user owns succeeds'''
|
'''Test collection of lists the specified user owns succeeds'''
|
||||||
self.api.get_owned_lists(screen_name='twitter')
|
self.api.show_owned_lists(screen_name='twitter')
|
||||||
|
|
||||||
# Saved Searches
|
# Saved Searches
|
||||||
def test_get_saved_searches(self):
|
def test_get_saved_searches(self):
|
||||||
|
|
@ -359,11 +370,11 @@ class TwythonAPITestCase(unittest.TestCase):
|
||||||
def test_create_get_destroy_saved_search(self):
|
def test_create_get_destroy_saved_search(self):
|
||||||
'''Test getting list of saved searches for authenticated
|
'''Test getting list of saved searches for authenticated
|
||||||
user succeeds'''
|
user succeeds'''
|
||||||
saved_search = self.api.create_saved_search(query='#ArnoldPalmer')
|
saved_search = self.api.create_saved_search(query='#Twitter')
|
||||||
saved_search_id = saved_search['id_str']
|
saved_search_id = saved_search['id_str']
|
||||||
|
|
||||||
self.api.show_saved_search(id=saved_search_id)
|
self.api.show_saved_search(id=saved_search_id)
|
||||||
self.api.destory_saved_search(id=saved_search_id)
|
self.api.destroy_saved_search(id=saved_search_id)
|
||||||
|
|
||||||
# Places & Geo
|
# Places & Geo
|
||||||
def test_get_geo_info(self):
|
def test_get_geo_info(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue