当前位置: 首页>>代码示例>>Python>>正文


Python framework.MiroTestCase类代码示例

本文整理汇总了Python中miro.test.framework.MiroTestCase的典型用法代码示例。如果您正苦于以下问题:Python MiroTestCase类的具体用法?Python MiroTestCase怎么用?Python MiroTestCase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了MiroTestCase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUp

 def setUp(self):
     MiroTestCase.setUp(self)
     self.manual_feed = Feed(u'dtv:manualFeed')
     self.regular_feed = Feed(u'http://example.com/1')
     self.path, fp = self.make_temp_path_fileobj(".avi")
     fp.write("fake data")
     fp.close()
开发者ID:CodeforEvolution,项目名称:miro,代码行数:7,代码来源:itemtest.py

示例2: setUp

 def setUp(self):
     MiroTestCase.setUp(self)
     self.feed = Feed(u'http://example.com/1')
     self.item1 = Item(fp_values_for_url(u'http://example.com/1/item1'),
             feed_id=self.feed.id)
     self.item2 = Item(fp_values_for_url(u'http://example.com/1/item2'),
             feed_id=self.feed.id)
开发者ID:cool-RR,项目名称:Miro,代码行数:7,代码来源:itemtest.py

示例3: setUp

 def setUp(self):
     MiroTestCase.setUp(self)
     FakeInfo.counter = itertools.count()
     self.infolist = self.build_infolist()
     self.sorter = self.sort_key_func
     self.reverse = False
     self.correct_infos = []
开发者ID:kmshi,项目名称:miro,代码行数:7,代码来源:infolisttest.py

示例4: tearDown

 def tearDown(self):
     MiroTestCase.tearDown(self)
     logger = logging.getLogger()
     logger.setLevel(self._log_level)
     for old_filter in logger.filters:
         logger.removeFilter(old_filter)
     for filter in self._old_filters:
         logger.addFilter(filter)
开发者ID:nxmirrors,项目名称:miro,代码行数:8,代码来源:databasetest.py

示例5: setUp

 def setUp(self):
     MiroTestCase.setUp(self)
     self.items = []
     self.feed = Feed(u'dtv:manualFeed')
     self.items = [
         testobjects.make_item(self.feed, u'item-1'),
         testobjects.make_item(self.feed, u'item-2'),
     ]
开发者ID:bluezone,项目名称:miro,代码行数:8,代码来源:messagetest.py

示例6: setUp

 def setUp(self):
     MiroTestCase.setUp(self)
     self.init_data_package()
     self.feed = models.Feed(u'http://example.com/feed.rss')
     self.items = [testobjects.make_item(self.feed, u'item-%s' % i)
                   for i in xrange(10)]
     app.db.finish_transaction()
     self.pool = itemlist.ItemListPool()
     self.item_list = self.pool.get('feed', self.feed.id)
     self.item_list2 = self.pool.get('feed', self.feed.id + 1)
开发者ID:bluezone,项目名称:miro,代码行数:10,代码来源:itemlisttest.py

示例7: setUp

 def setUp(self):
     MiroTestCase.setUp(self)
     self.mock_grab_headers = self.patch_for_test("miro.httpclient.grab_headers")
     self.mock_try_scraping_url = self.patch_for_test("miro.flashscraper.try_scraping_url")
     self.mock_send = self.patch_for_test("miro.dl_daemon.command.Command.send")
     self.feed = testobjects.make_feed()
     self.url = u"http://example.com/my-video.mp4"
     self.item = testobjects.make_item(self.feed, u"my item", url=self.url)
     self.downloading_path = os.path.join(self.tempdir, "Incomplete Downloads", "download.mp4")
     self.final_path = os.path.join(self.tempdir, "download.mp4")
开发者ID:ktan2020,项目名称:miro,代码行数:10,代码来源:downloadertest.py

示例8: setUp

 def setUp(self):
     MiroTestCase.setUp(self)
     self.device = mock.Mock()
     self.device.database = devices.DeviceDatabase()
     self.device.database[u'audio'] = {}
     self.device.mount = self.tempdir
     self.device.id = 123
     self.device.name = 'Device'
     self.device.size = 1024000
     os.makedirs(os.path.join(self.device.mount, '.miro'))
开发者ID:ShriramK,项目名称:miro,代码行数:10,代码来源:devicestest.py

示例9: setUp

    def setUp(self):
        app.testing_mdp = True # hack to override moviedata's in_unit_tests hack
        MiroTestCase.setUp(self)
        self.feed = models.Feed(u'dtv:manualFeed')
        mp3_path = resources.path("testdata/metadata/mp3-0.mp3")
        webm_path = resources.path("testdata/metadata/webm-0.webm")
        jpg_path = resources.path("testdata/dean.jpg")

        self.audio_item = models.FileItem(mp3_path, self.feed.id)
        self.video_item = models.FileItem(webm_path, self.feed.id)
        self.other_item = models.FileItem(jpg_path, self.feed.id)
开发者ID:codito,项目名称:miro,代码行数:11,代码来源:moviedatatest.py

示例10: setUp

 def setUp(self):
     MiroTestCase.setUp(self)
     self.mock_item_list_pool = self.patch_for_test(
         'miro.app.item_list_pool')
     self.items = [
         mock.Mock(id=0, title='one', is_playable=True),
         mock.Mock(id=1, title='two', is_playable=True),
         mock.Mock(id=2, title='three', is_playable=False),
         mock.Mock(id=3, title='four', is_playable=True),
     ]
     self.item_list = MockItemList(self.items)
开发者ID:CodeforEvolution,项目名称:miro,代码行数:11,代码来源:playbacktest.py

示例11: setUp

    def setUp(self):
        MiroTestCase.setUp(self)
        self.feed = feed.Feed(u"http://feed.org")
        self.i1 = item.Item(item.FeedParserValues({'title': u'item1'}),
                            feed_id=self.feed.id)
        self.i2 = item.Item(item.FeedParserValues({'title': u'item2'}),
                            feed_id=self.feed.id)

        self.feed2 = feed.Feed(u"http://feed.com")
        self.i3 = item.Item(item.FeedParserValues({'title': u'item3'}),
                            feed_id=self.feed2.id)
开发者ID:CodeforEvolution,项目名称:miro,代码行数:11,代码来源:databasetest.py

示例12: setUp

    def setUp(self):
        MiroTestCase.setUp(self)
        logger = logging.getLogger()
        self._log_level = logger.getEffectiveLevel()
        self._old_filters = logger.filters

        self.log_filter = LogFilter()
        logger.setLevel(logging.DEBUG)
        for old_filter in logger.filters:
            logger.removeFilter(old_filter)
        logger.addFilter(self.log_filter)
开发者ID:nxmirrors,项目名称:miro,代码行数:11,代码来源:databasetest.py

示例13: setUp

    def setUp(self):
        MiroTestCase.setUp(self)
        ITUNES_FILE = "iTunes Music Library.xml"

        # import_itunes_path expects a named file directory path that
        # contains filename ITUNES_FILE underneath it.
        fd = -1
        self.tmpf_path = os.path.join(self.tempdir, ITUNES_FILE)
        fd = os.open(self.tmpf_path, os.O_RDWR | os.O_CREAT | os.O_EXCL)
        self.tmpf = os.fdopen(fd, 'w')
        self.file_url = "file://localhost"
开发者ID:CodeforEvolution,项目名称:miro,代码行数:11,代码来源:importtest.py

示例14: setUp

 def setUp(self):
     MiroTestCase.setUp(self)
     self.renderer = itemrenderer.ItemRenderer()
     self.feed = models.Feed(u'http://example.com/feed.rss')
     self.item = testobjects.make_item(self.feed, u'item')
     self.manual_feed = models.Feed(u'dtv:manualFeed',
                                    initiallyAutoDownloadable=False)
     self.file_item = models.FileItem(self.make_temp_path(),
                                      self.manual_feed.id)
     app.saved_items = set()
     app.playback_manager = mock.Mock()
     app.playback_manager.item_resume_policy.return_value = False
开发者ID:CodeforEvolution,项目名称:miro,代码行数:12,代码来源:itemrenderertest.py

示例15: setUp

 def setUp(self):
     MiroTestCase.setUp(self)
     self.init_data_package()
     self.feed = models.Feed(u'http://example.com/feed.rss')
     self.items = [testobjects.make_item(self.feed, u'item-%s' % i)
                   for i in xrange(10)]
     app.db.finish_transaction()
     self.item_list = itemlist.ItemList('feed', self.feed.id)
     self.items_changed_handler = mock.Mock()
     self.list_changed_handler = mock.Mock()
     self.item_list.connect("items-changed", self.items_changed_handler)
     self.item_list.connect("list-changed", self.list_changed_handler)
开发者ID:dankamongmen,项目名称:miro,代码行数:12,代码来源:itemlisttest.py


注:本文中的miro.test.framework.MiroTestCase类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。