예제 #1
0
    def test_should_get_post_activity(self):
        post_repository_mock = Mock()
        when(post_repository_mock).activity("123guid", "123pubid", 5).thenReturn("activity")

        post = Post()
        post.post_repository = post_repository_mock
        post.guid = "123guid"
        post.pubid = "123pubid"

        assert post.activity(count=5) == "activity"
예제 #2
0
    def test_should_get_post_activity(self):
        post_repository_mock = Mock()
        when(post_repository_mock).activity('123guid', '123pubid', 5).thenReturn('activity')

        post = Post()
        post.post_repository = post_repository_mock
        post.guid = '123guid'
        post.pubid = '123pubid'

        assert post.activity(count=5) == 'activity'
예제 #3
0
 def test_should_return_post_activity(self):
     post_repository_mock = Mock()
     when(post_repository_mock).activity('some_guid', 'some_pubid', 10).thenReturn(['post_activity'])
     
     data = {'guid':'some_guid', 'pubid':'some_pubid', 
             'type':'post', 'caption':'blah', 'content':'blah', 
             'comment':'blah', 'url':'http://meme.yahoo.com/p/123', 
             'timestamp':'1234567890', 'repost_count':'12345'}      
     
     post = Post(data)
     post.post_repository = post_repository_mock
     
     assert post.activity(10) == ['post_activity']