當前位置: 首頁>>代碼示例>>Python>>正文


Python Media.example方法代碼示例

本文整理匯總了Python中mediadrop.model.Media.example方法的典型用法代碼示例。如果您正苦於以下問題:Python Media.example方法的具體用法?Python Media.example怎麽用?Python Media.example使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在mediadrop.model.Media的用法示例。


在下文中一共展示了Media.example方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: setUp

# 需要導入模塊: from mediadrop.model import Media [as 別名]
# 或者: from mediadrop.model.Media import example [as 別名]
    def setUp(self):
        super(FilteringRestrictedItemsTest, self).setUp()

        # without explicit re-registration of the default policy unit tests
        # failed when running 'python setup.py test'
        self._register_default_policy()
        # get rid of default media
        Media.query.delete()
        self.private_media = Media.example(slug=u"private")
        self.public_media = Media.example(slug=u"public")
        self.permission_system = MediaDropPermissionSystem(self.pylons_config)
        self.media_query = Media.query
        user = self._create_user_without_groups()
        self.perm = UserPermissions(user, self.permission_system)
開發者ID:njZhuMin,項目名稱:mediacore-community,代碼行數:16,代碼來源:filtering_restricted_items_test.py

示例2: test_does_not_set_type_if_only_audio_description_files_are_attached

# 需要導入模塊: from mediadrop.model import Media [as 別名]
# 或者: from mediadrop.model.Media import example [as 別名]
 def test_does_not_set_type_if_only_audio_description_files_are_attached(self, suffix):
     media = Media.example()
     assert_none(media.type)
     media_file = self.add_external_file(media, suffix)
     media_file.type = AUDIO_DESC
     media.update_status()
     assert_none(media.type, message='did detect media with audio description file as %s' % media.type)
開發者ID:SmallsLIVE,項目名稱:mediadrop,代碼行數:9,代碼來源:media_status_test.py

示例3: test_sets_video_type_if_media_contains_audio_and_video_files

# 需要導入模塊: from mediadrop.model import Media [as 別名]
# 或者: from mediadrop.model.Media import example [as 別名]
 def test_sets_video_type_if_media_contains_audio_and_video_files(self):
     media = Media.example()
     assert_none(media.type)
     self.add_external_file(media, 'mp4')
     self.add_external_file(media, 'mp3')
     media.update_status()
     assert_equals(VIDEO, media.type, message='did not detect mixed video/audio media as VIDEO type')
開發者ID:SmallsLIVE,項目名稱:mediadrop,代碼行數:9,代碼來源:media_status_test.py

示例4: setUp

# 需要導入模塊: from mediadrop.model import Media [as 別名]
# 或者: from mediadrop.model.Media import example [as 別名]
 def setUp(self):
     super(MediaStatusUpdatesTypeTest, self).setUp()
     # prevent warning about missing handlers for logger 
     # "mediadrop.model.players" ("fetch_enabled_players()")
     self.init_flowplayer()
     # required because "media.update_status()" will query
     # "registered_media_types()" which in turn calls "register_default_types()"
     # and then we need a translator (e.g. "_('Video')").
     paste_registry = self.pylons_config['paste.registry']
     setup_global_translator(registry=paste_registry)
     self.media = Media.example()
開發者ID:MatrixFrog,項目名稱:mediadrop,代碼行數:13,代碼來源:media_status_test.py

示例5: test_can_create_example_media

# 需要導入模塊: from mediadrop.model import Media [as 別名]
# 或者: from mediadrop.model.Media import example [as 別名]
 def test_can_create_example_media(self):
     media = Media.example()
     
     assert_not_none(media.id)
     assert_equals(u'Foo Media', media.title)
     assert_equals(u'foo-media', media.slug)
     assert_equals(Author(u'Joe', u'[email protected]'), media.author)
     assert_length(0, media.files)
     
     assert_none(media.type)
     assert_none(media.podcast_id)
     
     assert_false(media.publishable)
     assert_false(media.reviewed)
     assert_false(media.encoded)
     assert_none(media.publish_on)
     assert_none(media.publish_until)
     assert_false(media.is_published)
開發者ID:SmallsLIVE,項目名稱:mediadrop,代碼行數:20,代碼來源:media_example_test.py

示例6: setUp

# 需要導入模塊: from mediadrop.model import Media [as 別名]
# 或者: from mediadrop.model.Media import example [as 別名]
 def setUp(self):
     super(MediaTest, self).setUp()
     setup_global_translator(registry=self.paste_registry)
     self.init_flowplayer()
     self.media = Media.example()
     self.encoding_event = self.create_spy_on_event(events.Media.encoding_done)
開發者ID:hotbaby,項目名稱:mediadrop,代碼行數:8,代碼來源:media_test.py

示例7: test_does_not_set_type_if_only_caption_files_are_attached

# 需要導入模塊: from mediadrop.model import Media [as 別名]
# 或者: from mediadrop.model.Media import example [as 別名]
 def test_does_not_set_type_if_only_caption_files_are_attached(self, suffix):
     media = Media.example()
     assert_none(media.type)
     self.add_external_file(media, suffix)
     media.update_status()
     assert_none(media.type, message='did detect media with caption file as %s' % media.type)
開發者ID:SmallsLIVE,項目名稱:mediadrop,代碼行數:8,代碼來源:media_status_test.py

示例8: test_can_detect_audio_files

# 需要導入模塊: from mediadrop.model import Media [as 別名]
# 或者: from mediadrop.model.Media import example [as 別名]
 def test_can_detect_audio_files(self, suffix):
     media = Media.example()
     assert_not_equals(AUDIO, media.type)
     self.add_external_file(media, suffix)
     media.update_status()
     assert_equals(AUDIO, media.type, message='did not detect %s as AUDIO type' % suffix)
開發者ID:SmallsLIVE,項目名稱:mediadrop,代碼行數:8,代碼來源:media_status_test.py

示例9: setUp

# 需要導入模塊: from mediadrop.model import Media [as 別名]
# 或者: from mediadrop.model.Media import example [as 別名]
 def setUp(self):
     super(MediaStatusUpdatesTypeTest, self).setUp()
     # prevent warning about missing handlers for logger 
     # "mediadrop.model.players" ("fetch_enabled_players()")
     self.init_flowplayer()
     self.media = Media.example()
開發者ID:SmallsLIVE,項目名稱:mediadrop,代碼行數:8,代碼來源:media_status_test.py

示例10: setUp

# 需要導入模塊: from mediadrop.model import Media [as 別名]
# 或者: from mediadrop.model.Media import example [as 別名]
 def setUp(self):
     super(MediaTest, self).setUp()
     self.init_flowplayer()
     self.media = Media.example()
     self.encoding_event = self.create_spy_on_event(events.Media.encoding_done)
開發者ID:SmallsLIVE,項目名稱:mediadrop,代碼行數:7,代碼來源:media_test.py

示例11: test_can_override_example_data

# 需要導入模塊: from mediadrop.model import Media [as 別名]
# 或者: from mediadrop.model.Media import example [as 別名]
 def test_can_override_example_data(self):
     media = Media.example(title=u'Bar Foo')
     
     assert_equals(u'Bar Foo', media.title)
     assert_equals(u'bar-foo', media.slug)
開發者ID:SmallsLIVE,項目名稱:mediadrop,代碼行數:7,代碼來源:media_example_test.py


注:本文中的mediadrop.model.Media.example方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。