~paulliu/friends/add-twitter-contacts

« back to all changes in this revision

Viewing changes to friends/tests/test_twitter.py

  • Committer: Ken VanDine
  • Date: 2012-11-16 20:05:40 UTC
  • mfrom: (72.1.5 notify)
  • Revision ID: ken.vandine@canonical.com-20121116200540-f5xj0r8pyq0zo8d5
Merged notification support from robru

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
 
40
40
 
41
41
@mock.patch('friends.utils.http._soup', mock.Mock())
 
42
@mock.patch('friends.utils.base.notify', mock.Mock())
42
43
class TestTwitter(unittest.TestCase):
43
44
    """Test the Twitter API."""
44
45
 
201
202
 
202
203
        self.protocol.mentions()
203
204
 
204
 
        publish.assert_called_with('tweet')
 
205
        publish.assert_called_with('tweet', stream='mentions')
205
206
        get_url.assert_called_with(
206
207
            'https://api.twitter.com/1.1/statuses/mentions_timeline.json')
207
208
 
211
212
 
212
213
        self.protocol.user()
213
214
 
214
 
        publish.assert_called_with('tweet')
 
215
        publish.assert_called_with('tweet', stream='messages')
215
216
        get_url.assert_called_with(
216
217
        'https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=')
217
218
 
221
222
 
222
223
        self.protocol.list('some_list_id')
223
224
 
224
 
        publish.assert_called_with('tweet')
 
225
        publish.assert_called_with('tweet', stream='list/some_list_id')
225
226
        get_url.assert_called_with(
226
227
        'https://api.twitter.com/1.1/lists/statuses.json?list_id=some_list_id')
227
228