Log In
New Account
  
Home My Page Project Cloud Code Snippets Project Openings Hermes
Summary Lists News SCM
authorFredrik Wendt <fredrik@wendt.se>
Tue, 8 Jun 2010 17:43:51 +0000 (18:43 +0100)
committerFredrik Wendt <fredrik@wendt.se>
Tue, 8 Jun 2010 17:43:51 +0000 (18:43 +0100)
Signed-off-by: Fredrik Wendt <fredrik@wendt.se>

package/test/integration/test_twitter.py [new file with mode: 0644]

diff --git a/package/test/integration/test_twitter.py b/package/test/integration/test_twitter.py
new file mode 100644 (file)
index 0000000..7f5a8af
--- /dev/null
@@ -0,0 +1,29 @@
+from org.maemo.hermes.engine.twitter.service import Service
+from org.maemo.hermes.engine.names import canonical
+import unittest
+import twitter
+
+class TestTwitterService(unittest.TestCase):
+    """Tests that needs human interaction (such as for authorization)"""
+    
+    def setUp(self):
+        self.api = twitter.Api(username="maemohermes", password="Eha8ohr7Cu")
+        self.testee = Service(self.api)
+    
+    
+    def test_main_flow(self):
+        self._exercise_service([])
+        
+        assert len(self.testee.get_unmatched_friends()) > 0
+        assert len(self.testee.get_contacts_with_match()) == 0
+        
+
+    def _exercise_service(self, contacts):
+        for contact in contacts:
+            self.testee.pre_process_contact(contact)
+        self.testee.process_friends()
+        for contact in contacts:
+            self.testee.process_contact(contact)
+    
+if __name__ == '__main__':
+    unittest.main()

Terms of Use    Privacy Policy    Contribution Guidelines    Feedback

Powered By GForge Collaborative Development Environment