Restructure repository layout. Fixed test errors.
authorJosh Roesslein <jroesslein@gmail.com>
Thu, 30 Jul 2009 04:55:47 +0000 (23:55 -0500)
committerJosh Roesslein <jroesslein@gmail.com>
Thu, 30 Jul 2009 04:55:47 +0000 (23:55 -0500)
tests.py
tweepy/__init__.py [moved from __init__.py with 100% similarity]
tweepy/api.py [moved from api.py with 100% similarity]
tweepy/binder.py [moved from binder.py with 100% similarity]
tweepy/error.py [moved from error.py with 100% similarity]
tweepy/models.py [moved from models.py with 100% similarity]
tweepy/parsers.py [moved from parsers.py with 100% similarity]

index 8c089adf20ea2a59d976c1036c841abbdf458124..865c954bca33672c79555725bd24d74e324f050f 100644 (file)
--- a/tests.py
+++ b/tests.py
@@ -5,8 +5,7 @@
 import unittest
 import random
 
-from api import API
-from models import *
+from tweepy import *
 
 """Unit tests"""
 
@@ -19,7 +18,6 @@ class TweepyAPITests(unittest.TestCase):
 
   def setUp(self):
     self.api = API(self.username, self.password)
-    self.update_status_id = None
 
   def testsetcredentials(self):
     testapi = API()
@@ -53,21 +51,20 @@ class TweepyAPITests(unittest.TestCase):
     self.assert_(isinstance(s,Status))
     self.assertEqual(s.user.id, 17)
 
-  def testupdatestatus(self):
+  def testupdateanddestroystatus(self):
+    # test update
     text = 'testing %i' % random.randint(0,1000)
-    update = self.api.update_status('status'=text)
+    update = self.api.update_status(status=text)
     self.assert_(isinstance(update,Status))
     self.assertEqual(update.text, text)
-    self.update_status_id = update.id
 
-  def testdestroystatus(self):
-    self.assert_(self.update_status_id)
-    deleted = self.api.destroy_status(id=self.update_status_id)
+    # test destroy
+    deleted = self.api.destroy_status(id=update.id)
     self.assert_(isinstance(deleted,Status))
-    self.assertEqual(deleted.id, self.update_status_id)
+    self.assertEqual(deleted.id, update.id)
 
-  def testshowuser(self):
-    u = self.api.show_user(screen_name='twitter')
+  def testgetuser(self):
+    u = self.api.get_user(screen_name='twitter')
     self.assert_(isinstance(u,User))
     self.assertEqual(u.screen_name, 'twitter')
 
similarity index 100%
rename from __init__.py
rename to tweepy/__init__.py
similarity index 100%
rename from api.py
rename to tweepy/api.py
similarity index 100%
rename from binder.py
rename to tweepy/binder.py
similarity index 100%
rename from error.py
rename to tweepy/error.py
similarity index 100%
rename from models.py
rename to tweepy/models.py
similarity index 100%
rename from parsers.py
rename to tweepy/parsers.py