本文整理汇总了Python中MaKaC.plugins.PluginsHolder.reloadAllPlugins方法的典型用法代码示例。如果您正苦于以下问题:Python PluginsHolder.reloadAllPlugins方法的具体用法?Python PluginsHolder.reloadAllPlugins怎么用?Python PluginsHolder.reloadAllPlugins使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MaKaC.plugins.PluginsHolder
的用法示例。
在下文中一共展示了PluginsHolder.reloadAllPlugins方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: runTests
# 需要导入模块: from MaKaC.plugins import PluginsHolder [as 别名]
# 或者: from MaKaC.plugins.PluginsHolder import reloadAllPlugins [as 别名]
def runTests(host='localhost', port=FAKE_SERVICE_PORT,
scenarios=[(2, 10)]):
execTimes = []
agent = InvenioBatchUploaderAgent('test1', 'test1', 'test',
0, 'http://%s:%s' \
% (host, port))
ph = PluginsHolder()
ph.reloadAllPlugins()
ph.getPluginType('livesync').toggleActive()
do = DummyObservable()
do._notify('updateDBStructures', 'indico.ext.livesync',
None, None, None)
sm = SyncManager.getDBInstance()
sm.registerNewAgent(agent)
cm = CategoryManager()
avatar = user.Avatar()
avatar.setName( "fake" )
avatar.setSurName( "fake" )
avatar.setOrganisation( "fake" )
avatar.setLang( "en_GB" )
avatar.setEmail( "[email protected]" )
#registering user
ah = user.AvatarHolder()
ah.add(avatar)
#setting up the login info
li = user.LoginInfo( "dummyuser", "dummyuser" )
ih = AuthenticatorMgr()
userid = ih.createIdentity( li, avatar, "Local" )
ih.add( userid )
#activate the account
avatar.activateAccount()
#since the DB is empty, we have to add dummy user as admin
minfo = HelperMaKaCInfo.getMaKaCInfoInstance()
al = minfo.getAdminList()
al.grant( avatar )
dummy = avatar
ContextManager.destroy()
HelperMaKaCInfo.getMaKaCInfoInstance().setDefaultConference(DefaultConference())
cm.getRoot()
do._notify('requestStarted')
home = cm.getById('0')
# execute code
for nconf in range(0, 1000):
conf = home.newConference(dummy)
conf.setTitle('Test Conference %s' % nconf)
do._notify('requestFinished')
time.sleep(1)
# params won't be used
task = LiveSyncUpdateTask(dateutil.rrule.MINUTELY)
for scen in scenarios:
print "Scenario %s workers, size = %s " % scen,
# configure scenario
InvenioBatchUploaderAgent.NUM_WORKERS = scen[0]
InvenioBatchUploaderAgent.BATCH_SIZE = scen[1]
ts = time.time()
# just run it
task.run()
te = time.time()
execTimes.append(te - ts)
print "%s" % (te - ts)
sm._track._pointers['test1'] = None
for i in range(0, len(execTimes)):
results[scenarios[i]] = execTimes[i]