def test_should_create_video_card_attachment(self):
        media = [MediaUrl(url='https://example.org/media')]
        card = VideoCard(title='test', media=media)
        attachment = CardFactory.video_card(card)

        assert_attachment(attachment, CardFactory.content_types.video_card)
        assert attachment.content.title == 'test', 'wrong title.'
        assert_media(attachment.content.media, 1,
                     ['https://example.org/media'])
示例#2
0
    def test_should_create_video_card_attachment(self):
        media = [MediaUrl(url="https://example.org/media")]
        card = VideoCard(title="test", media=media)
        attachment = CardFactory.video_card(card)

        assert_attachment(attachment, CardFactory.content_types.video_card)
        assert attachment.content.title == "test", "wrong title."
        assert_media(attachment.content.media, 1,
                     ["https://example.org/media"])
示例#3
0
def create_video_card() -> Attachment:
    card = VideoCard(title='Big Buck Bunny',
                     subtitle='by the Blender Institute',
                     text='Big Buck Bunny (code-named Peach) is a short computer-animated comedy film by the Blender '
                          'Institute, part of the Blender Foundation. Like the foundation\'s previous film Elephants '
                          'Dream, the film was made using Blender, a free software application for animation made by '
                          'the same foundation. It was released as an open-source film under Creative Commons License '
                          'Attribution 3.0.',
                     media=[MediaUrl(url='http://download.blender.org/peach/bigbuckbunny_movies/'
                                          'BigBuckBunny_320x180.mp4')],
                     buttons=[CardAction(type=ActionTypes.open_url,
                                         title='Learn More',
                                         value='https://peach.blender.org/')])
    return CardFactory.video_card(card)
示例#4
0
 def create_video_card(self) -> Attachment:
     card = VideoCard(
         title="Big Buck Bunny",
         subtitle="by the Blender Institute",
         text=
         "Big Buck Bunny (code-named Peach) is a short computer-animated comedy film by the Blender "
         "Institute, part of the Blender Foundation. Like the foundation's previous film Elephants "
         "Dream, the film was made using Blender, a free software application for animation made by "
         "the same foundation. It was released as an open-source film under Creative Commons License "
         "Attribution 3.0.",
         media=[
             MediaUrl(
                 url="http://download.blender.org/peach/bigbuckbunny_movies/"
                 "BigBuckBunny_320x180.mp4")
         ],
         buttons=[
             CardAction(
                 type=ActionTypes.open_url,
                 title="Learn More",
                 value="https://peach.blender.org/",
             )
         ],
     )
     return CardFactory.video_card(card)
示例#5
0
 def create_video_card(url: str) -> Attachment:
     card = VideoCard(
         title="Video Card",
         media=[MediaUrl(url=url)],
     )
     return CardFactory.video_card(card)