Add unit test for {c:44cc749}
authorAndrew Flegg <andrew@bleb.org>
Sun, 2 Jan 2011 13:50:15 +0000 (13:50 +0000)
committerAndrew Flegg <andrew@bleb.org>
Sun, 2 Jan 2011 19:58:04 +0000 (19:58 +0000)
package/test/unit/test_facebook.py

index 2b3e958..08e4c86 100644 (file)
@@ -34,11 +34,14 @@ class FakeOAuth():
             return '{"id":"1234567","name":"Maemo Hermes"}'
         
         elif url == 'https://graph.facebook.com/me/friends':
-            return '{"data":[{"id":"1","name":"J Smith","website":"http:\/\/www.example.org"},{"id":"2","name":"P Barnum"}]}'
+            return '{"data":[{"id":"1","name":"J Smith","website":"http:\/\/www.example.org"},{"id":"2","name":"P Barnum","picture":"http://fbcn.example.com/32939012.jpg"}]}'
         
         else:
             raise Exception("Unknown URL: %s" % (url))
         
+    def get_access_token(self):
+        return 'XXX'
+        
 
 class TestFacebookService(unittest.TestCase):
     
@@ -191,6 +194,7 @@ class TestFacebookAPI(unittest.TestCase):
         assert len(friends) == 2
         assert friends[0]['name'] == 'J Smith'
         assert friends[1]['id'] == '2'
+        assert friends[1]['picture'] == 'https://graph.facebook.com/2/picture?type=large&access_token=XXX'
 
     
 if __name__ == '__main__':