def do_test(self, domsgbox=True):
global myconfig
self._tmp_home = None
home_dir, config_name = gconsole.check_args()
if not (config_name.find('/') >= 0 or config_name.find('\\') >= 0):
config_name = os.path.join(home_dir, config_name)
log.debug("config file used: %s", config_name)
myconfig = config.Config(file=config_name)
initialize.locations(self, home_dir)
gettext.install('griffith', self.locations['i18n'], unicode=1)
search_successful = ''
search_unsuccessful = ''
get_successful = ''
get_unsuccessful = ''
# test all plugins ?
test_all = True
dialog = gtk.MessageDialog(None,
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
gtk.MESSAGE_QUESTION, gtk.BUTTONS_NONE, 'Test all plugins ?')
dialog.add_buttons(gtk.STOCK_YES, gtk.RESPONSE_YES,
gtk.STOCK_NO, gtk.RESPONSE_NO)
dialog.set_default_response(gtk.RESPONSE_NO)
dialog.set_skip_taskbar_hint(False)
response = dialog.run()
dialog.destroy()
if not response == gtk.RESPONSE_YES:
test_all = False
# iterate through all testable plugins
for i in self.test_plugins:
if domsgbox and test_all == False:
# ask for test of that specific plugin
dialog = gtk.MessageDialog(None,
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
gtk.MESSAGE_QUESTION, gtk.BUTTONS_NONE, 'Test plugin %s ?' %i)
dialog.add_buttons(gtk.STOCK_YES, gtk.RESPONSE_YES,
gtk.STOCK_NO, gtk.RESPONSE_NO)
dialog.set_default_response(gtk.RESPONSE_NO)
dialog.set_skip_taskbar_hint(False)
response = dialog.run()
dialog.destroy()
if not response == gtk.RESPONSE_YES:
continue
print "Starting test of plugin: %s" % i
plugin = __import__(i)
# search test
if self.do_test_searchplugin(i, False):
search_successful = search_successful + i + ', '
else:
search_unsuccessful = search_unsuccessful + i + ', '
# movie test
if self.do_test_plugin(i, False):
get_successful = get_successful + i + ', '
else:
get_unsuccessful = get_unsuccessful + i + ', '
if domsgbox:
gutils.info('SearchPluginTests\n Success: %s\n Failed: %s\n\nPluginTests\n Success: %s\n Failed: %s' % (search_successful, search_unsuccessful, get_successful, get_unsuccessful))
#
# Start the tests
#
评论列表
文章目录