本文整理汇总了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)
示例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()
示例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)
示例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()
示例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)
示例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()
示例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()
示例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)
示例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
示例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)
示例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))
示例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)