예제 #1
0
 def test_should_get_meme_followers(self):
     meme_repository_mock = Mock()
     when(meme_repository_mock).followers('some_name', 10, 0).thenReturn(['meme_followers'])
     
     meme = Meme()
     meme.meme_repository = meme_repository_mock
     meme.name = 'some_name'
     
     assert meme.followers() == ['meme_followers']
예제 #2
0
    def test_should_get_meme_most_reposted_posts(self):
        post_repository_mock = Mock()
        when(post_repository_mock).get_most_reposted_by_meme("name", "", 10).thenReturn("meme_posts")

        meme = Meme()
        meme.post_repository = post_repository_mock
        meme.name = "name"

        assert meme.most_reposted_posts() == "meme_posts"
예제 #3
0
    def test_should_get_meme_most_reposted_video_posts(self):
        post_repository_mock = Mock()
        when(post_repository_mock).get_most_reposted_by_meme("name", "video", 5).thenReturn("meme_posts")

        meme = Meme()
        meme.post_repository = post_repository_mock
        meme.name = "name"

        assert meme.most_reposted_posts(media="video", count=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_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"
예제 #6
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']
예제 #7
0
    def test_should_get_meme_most_reposted_video_posts(self):
        post_repository_mock = Mock()
        when(post_repository_mock).get_most_reposted_by_meme('name', 'video', 5).thenReturn('meme_posts')

        meme = Meme()
        meme.post_repository = post_repository_mock
        meme.name = 'name'

        assert meme.most_reposted_posts(media='video', count=5) == 'meme_posts'
예제 #8
0
    def test_should_get_meme_most_reposted_posts(self):
        post_repository_mock = Mock()
        when(post_repository_mock).get_most_reposted_by_meme('name', '', 10).thenReturn('meme_posts')

        meme = Meme()
        meme.post_repository = post_repository_mock
        meme.name = 'name'

        assert meme.most_reposted_posts() == 'meme_posts'
예제 #9
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'
예제 #10
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'
예제 #11
0
파일: app.py 프로젝트: 5top1t/MemeTube
def index():
	if request.json:
		print(request.args)
		print(request.json)
		vtag = request.json['vTag']
		timestamp = request.json['timestamp']
		bottom = False if 'bottom' not in request.json else request.json['bottom']
		comment = request.json['comment']

		collage = Meme(vtag, timestamp, comment)
		status = collage.youtube_artifacts_to_meme()
		collage.clean_artifacts()

		return {
			"success": status,
			"memeS3Url": collage.get_s3_meme()
		}

	return {
		"success": False,
		"message": "Missing json data",
		"memeS3Url": ""
	}