Пример #1
0
    def test_should_get_meme_posts(self):
        post_repository_mock = Mock()
        when(post_repository_mock).get_by_meme("some_guid", 5).thenReturn("meme_posts")

        meme = Meme()
        meme.post_repository = post_repository_mock
        meme.guid = "some_guid"

        assert meme.posts(5) == "meme_posts"
Пример #2
0
    def test_should_get_meme_followers(self):
        meme_repository_mock = Mock()
        when(meme_repository_mock).followers("some_guid", 10).thenReturn("meme_followers")

        meme = Meme()
        meme.meme_repository = meme_repository_mock
        meme.guid = "some_guid"

        assert meme.followers(10) == "meme_followers"
Пример #3
0
    def test_should_get_meme_posts(self):
        post_repository_mock = Mock()
        when(post_repository_mock).get_by_meme('some_guid', 5).thenReturn('meme_posts')

        meme = Meme()
        meme.post_repository = post_repository_mock
        meme.guid = 'some_guid'

        assert meme.posts(5) == 'meme_posts'
Пример #4
0
 def test_should_get_meme_followers(self):
     meme_repository_mock = Mock()
     when(meme_repository_mock).followers('some_guid', 10).thenReturn(['meme_followers'])
     
     meme = Meme()
     meme.meme_repository = meme_repository_mock
     meme.guid = 'some_guid'
     
     assert meme.followers(10) == ['meme_followers']
Пример #5
0
 def test_should_get_memes_following_a_meme(self):
     meme_repository_mock = Mock()
     when(meme_repository_mock).following('some_guid', 10).thenReturn('memes_following')
     
     meme = Meme()
     meme.meme_repository = meme_repository_mock
     meme.guid = 'some_guid'
     
     assert meme.following(10) == 'memes_following'