def setUp(self):
        self.fetched_image = PhotoFactory(twitter_id=99999999,
                                          image_file='downloaded.jpg')
        self.image = PhotoFactory(
            twitter_id=88888888,
            image_file='',
            image_url='https://pbs.twimg.com/media/abcdefghijklmno.png')

        self.animated_gif = AnimatedGifFactory(
            twitter_id=77777777,
            image_url=
            'https://pbs.twimg.com/tweet_video_thumb/1234567890abcde.png',
            mp4_url='https://pbs.twimg.com/tweet_video/abcde1234567890.mp4',
            image_file='',
            mp4_file='')

        self.video = VideoFactory(
            twitter_id=66666666,
            image_url=
            'https://pbs.twimg.com/ext_tw_video_thumb/740282905369444352/pu/img/zyxwvutsrqponml.jpg',
            image_file='',
            mp4_file='')
示例#2
0
 def test_video_url_dash(self):
     "Will be same as remote URL."
     video = VideoFactory(xmpeg_url='',
                         dash_url='https://example.org/test.mpd')
     self.assertEqual(video.video_url, video.dash_url)
示例#3
0
 def test_video_mime_type_dash(self):
     video = VideoFactory(xmpeg_url='',
                         dash_url='https://example.org/test.mpd')
     self.assertEqual(video.video_mime_type, 'application/dash+xml')
示例#4
0
 def test_video_mime_type_xmpeg(self):
     video = VideoFactory(xmpeg_url='https://example.org/test.m3u8')
     self.assertEqual(video.video_mime_type, 'application/x-mpegURL')
示例#5
0
 def test_video_url_empty(self):
     video = VideoFactory(xmpeg_url='', mp4_url='', dash_url='')
     self.assertEqual(video.video_url, '')
示例#6
0
 def test_video_url_mp4(self):
     video = VideoFactory(xmpeg_url='', dash_url='',
                         mp4_url='https://example.org/test.mp4')
     self.assertEqual(video.video_url, video.mp4_url)
示例#7
0
 def test_video_url_xmpeg(self):
     video = VideoFactory(xmpeg_url='https://example.org/test.m3u8')
     self.assertEqual(video.video_url, video.xmpeg_url)
示例#8
0
 def test_media_type(self):
     video = VideoFactory()
     self.assertEqual(video.media_type, 'video')
示例#9
0
 def test_str(self):
     video = VideoFactory()
     self.assertEqual(video.__str__(), 'Video %d' % video.id)
示例#10
0
 def test_str(self):
     video = VideoFactory()
     self.assertEqual(video.__str__(), 'Video %d' % video.id)