• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python framework.EventLoopTest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setUp

 def setUp(self):
     print 'setting up'
     EventLoopTest.setUp(self)
     # We want to store our database in a file, so that we can test
     # performance on a freshly opened db.
     save_path = FilenameType(self.make_temp_path(extension=".db"))
     if os.path.exists(save_path):
         os.unlink(save_path)
     self.reload_database(save_path)
     models.Feed(u'dtv:search')
     self.test_handler = messagetest.TestFrontendMessageHandler()
     messages.FrontendMessage.install_handler(self.test_handler)
     self.backend_message_handler = messagehandler.BackendMessageHandler(None)
     messages.BackendMessage.install_handler(self.backend_message_handler)
     self.feed = models.Feed(u'dtv:manualFeed')
     self.items = []
     template_file = self.make_temp_path(".avi")
     self.stats_path = self.make_temp_path(".prof")
     open(template_file, 'w').write(' ')
     app.bulk_sql_manager.start()
     for x in xrange(5000):
         path = self.make_temp_path(".avi")
         shutil.copyfile(template_file, path)
         models.FileItem(path, self.feed.id)
     app.bulk_sql_manager.finish()
     self.reload_database(save_path)
开发者ID:cool-RR,项目名称:Miro,代码行数:26,代码来源:performancetest.py


示例2: setUp

 def setUp(self):
     EventLoopTest.setUp(self)
     # need to call setup_tabs for PlaylistTracker() and
     # ChannelTracker()
     startup.setup_tabs()
     self.setup_config()
     self.setup_data()
开发者ID:CodeforEvolution,项目名称:miro,代码行数:7,代码来源:sharingtest.py


示例3: tearDown

 def tearDown(self):
     self.remove_database()
     corrupt_path = os.path.join(os.path.dirname(self.save_path), "corrupt_database")
     if os.path.exists(corrupt_path):
         os.remove(corrupt_path)
     databaseupgrade._upgrade_overide = {}
     EventLoopTest.tearDown(self)
开发者ID:cool-RR,项目名称:Miro,代码行数:7,代码来源:storedatabasetest.py


示例4: setUp

 def setUp(self):
     EventLoopTest.setUp(self)
     # override the normal handler class with our own
     workerprocess._subprocess_manager.handler_class = (
             UnittestWorkerProcessHandler)
     workerprocess._subprocess_manager.restart_delay = 0
     self.reset_results()
开发者ID:ShriramK,项目名称:miro,代码行数:7,代码来源:subprocesstest.py


示例5: setUp

 def setUp(self):
     EventLoopTest.setUp(self)
     self.feed = Feed(u"http://feed.uk")
     self.i1 = Item(FeedParserValues({"title": u"item1"}), feed_id=self.feed.id)
     self.i2 = Item(FeedParserValues({"title": u"item2"}), feed_id=self.feed.id)
     self.i3 = Item(FeedParserValues({"title": u"item3"}), feed_id=self.feed.id)
     self.i4 = Item(FeedParserValues({"title": u"item4"}), feed_id=self.feed.id)
开发者ID:ktan2020,项目名称:miro,代码行数:7,代码来源:playlisttest.py


示例6: setUp

 def setUp(self):
     EventLoopTest.setUp(self)
     self.start_http_server()
     self.grab_url_info = self.grab_url_error = None
     self.expecting_errback = False
     self.event_loop_timeout = 1.0
     test_txt_path = resources.path("testdata/httpserver/test.txt")
     self.test_response_data = open(test_txt_path).read()
开发者ID:bluezone,项目名称:miro,代码行数:8,代码来源:httpclienttest.py


示例7: setUp

    def setUp(self):
        EventLoopTest.setUp(self)

        self.responder = TestSubprocessResponder()
        self.subprocess = subprocessmanager.SubprocessManager(TestMessage,
                self.responder, TestSubprocessHandler)
        self.subprocess.start()
        self._wait_for_subprocess_ready()
开发者ID:kmshi,项目名称:miro,代码行数:8,代码来源:subprocesstest.py


示例8: tearDown

 def tearDown(self):
     # need to close the db before removing it from disk
     app.db.close()
     self.remove_database()
     corrupt_path = os.path.join(os.path.dirname(self.save_path),
                                 'corrupt_database')
     if os.path.exists(corrupt_path):
         os.remove(corrupt_path)
     databaseupgrade._upgrade_overide = {}
     EventLoopTest.tearDown(self)
开发者ID:bluezone,项目名称:miro,代码行数:10,代码来源:storedatabasetest.py


示例9: setUp

 def setUp(self):
     EventLoopTest.setUp(self)
     app.directory_watcher = FakeDirectoryWatcher
     self.dir = self.make_temp_dir_path()
     self.url = u'dtv:directoryfeed:%s' % make_url_safe(self.dir)
     self.feed = models.Feed(self.url)
     self.source_path = resources.path("testdata/pop.mp3")
     self.directory_watcher = self.feed.actualFeed.watcher
     # not having to wait for a timeout makes the tests simpler and faster
     self.feed.actualFeed.DIRECTORY_WATCH_UPDATE_TIMEOUT = 0.0
开发者ID:codito,项目名称:miro,代码行数:10,代码来源:watchedfoldertest.py


示例10: setUp

 def setUp(self):
     EventLoopTest.setUp(self)
     self.feed = Feed(u"http://feed.uk")
     self.i1 = Item(FeedParserValues({'title': u'item1'}),
                    feed_id=self.feed.id)
     self.i2 = Item(FeedParserValues({'title': u'item2'}),
                    feed_id=self.feed.id)
     self.i3 = Item(FeedParserValues({'title': u'item3'}),
                    feed_id=self.feed.id)
     self.i4 = Item(FeedParserValues({'title': u'item4'}),
                    feed_id=self.feed.id)
开发者ID:cool-RR,项目名称:Miro,代码行数:11,代码来源:playlisttest.py


示例11: setUp

 def setUp(self):
     EventLoopTest.setUp(self)
     Feed(u'dtv:search')
     self.test_handler = TestFrontendMessageHandler()
     messages.FrontendMessage.install_handler(self.test_handler)
     self.backend_message_handler = messagehandler.BackendMessageHandler(
         None)
     messages.BackendMessage.install_handler(self.backend_message_handler)
     self.channelTabOrder = TabOrder(u'channel')
     self.playlistTabOrder = TabOrder(u'playlist')
     # Adding a guide ensures that if we remove all our
     # channel/playlist tabs the selection code won't go crazy.
     self.guide = ChannelGuide(app.config.get(prefs.CHANNEL_GUIDE_URL))
开发者ID:ShriramK,项目名称:miro,代码行数:13,代码来源:messagetest.py


示例12: setUp

 def setUp(self):
     EventLoopTest.setUp(self)
     self.updater = metadataprogress.MetadataProgressUpdater()
     # make messages send immediately to speed up test execution
     self.updater.message_interval = 0.0
     # setup a fake device to use
     self.device = mock.Mock()
     self.device.id = 123
     # make our handler
     self.test_handler = TestFrontendMessageHandler()
     messages.FrontendMessage.install_handler(self.test_handler)
     # the warnings from MetadataProgressUpdater should be errors in the
     # test case
     self.log_filter.set_exception_level(logging.WARNING)
开发者ID:codito,项目名称:miro,代码行数:14,代码来源:messagetest.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python framework.MiroTestCase类代码示例发布时间:2022-05-27
下一篇:
Python playlist.SavedPlaylist类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap