Fix some tests.
authorJosh Roesslein <jroesslein@gmail.com>
Thu, 30 Jul 2009 21:09:38 +0000 (16:09 -0500)
committerJosh Roesslein <jroesslein@gmail.com>
Thu, 30 Jul 2009 21:09:38 +0000 (16:09 -0500)
tests.py
tweepy/api.py

index 865c954bca33672c79555725bd24d74e324f050f..92b9d46102dcca3b464956a9730a7f06e421ebe1 100644 (file)
--- 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()
index 5b480536bf8ea4967305d33aa9e3d098cdfce7f3..3d8f2a072e78ab61335598c2c07e2628479f2fbc 100644 (file)
@@ -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