From d1eb7a9d484994684484196e59eb55cac2a70039 Mon Sep 17 00:00:00 2001 From: Josh Roesslein Date: Thu, 30 Jul 2009 16:09:38 -0500 Subject: [PATCH] Fix some tests. --- tests.py | 12 +++--------- tweepy/api.py | 3 ++- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/tests.py b/tests.py index 865c954..92b9d46 100644 --- a/tests.py +++ b/tests.py @@ -13,17 +13,11 @@ from tweepy import * class TweepyAPITests(unittest.TestCase): # Must supply twitter account credentials for tests - username = 'jitterapp' - password = 'omega123' + username = 'tweebly' + password = 'omega1987twitter' def setUp(self): - self.api = API(self.username, self.password) - - def testsetcredentials(self): - testapi = API() - testapi.set_credentials('test', 'donttellanyone') - self.assert_(testapi._b64up) - self.assertEqual(testapi.username, 'test') + self.api = API(BasicAuthHandler(self.username, self.password), self.username) def testpublictimeline(self): s = self.api.public_timeline() diff --git a/tweepy/api.py b/tweepy/api.py index 5b48053..3d8f2a0 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -10,11 +10,12 @@ from error import TweepError """Twitter API""" class API(object): - def __init__(self, auth_handler=None, host='twitter.com', cache=None, + def __init__(self, auth_handler=None, username=None, host='twitter.com', cache=None, secure=False, classes={'user': User, 'status': Status, 'direct_message': DirectMessage, 'friendship': Friendship, 'saved_search': SavedSearch, 'search_result': SearchResult}): self.auth_handler = auth_handler + self.username = username self.host = host self.cache = cache self.secure = secure -- 2.25.1