本文整理汇总了Python中psdash.run.PsDashRunner.create_from_args方法的典型用法代码示例。如果您正苦于以下问题:Python PsDashRunner.create_from_args方法的具体用法?Python PsDashRunner.create_from_args怎么用?Python PsDashRunner.create_from_args使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类psdash.run.PsDashRunner
的用法示例。
在下文中一共展示了PsDashRunner.create_from_args方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_reload_logs
# 需要导入模块: from psdash.run import PsDashRunner [as 别名]
# 或者: from psdash.run.PsDashRunner import create_from_args [as 别名]
def test_reload_logs(self):
_, filename = tempfile.mkstemp()
r = PsDashRunner.create_from_args(['-l', filename])
pre_count = len(r.app.psdash.logs.available)
c = r.reload_logs()
post_count = len(r.app.psdash.logs.available)
self.assertEqual(pre_count, post_count)
示例2: test_args_log
# 需要导入模块: from psdash.run import PsDashRunner [as 别名]
# 或者: from psdash.run.PsDashRunner import create_from_args [as 别名]
def test_args_log(self):
_, filename = tempfile.mkstemp()
r = PsDashRunner.create_from_args(['-l', filename])
self.assertEqual(r.app.config['PSDASH_LOGS'][0], filename)
示例3: test_args_debug
# 需要导入模块: from psdash.run import PsDashRunner [as 别名]
# 或者: from psdash.run.PsDashRunner import create_from_args [as 别名]
def test_args_debug(self):
r = PsDashRunner.create_from_args(['-d'])
self.assertTrue(r.app.debug)
示例4: test_args_port
# 需要导入模块: from psdash.run import PsDashRunner [as 别名]
# 或者: from psdash.run.PsDashRunner import create_from_args [as 别名]
def test_args_port(self):
r = PsDashRunner.create_from_args(['-p', '5555'])
self.assertEqual(r.app.config['PSDASH_PORT'], 5555)
示例5: test_args_bind
# 需要导入模块: from psdash.run import PsDashRunner [as 别名]
# 或者: from psdash.run.PsDashRunner import create_from_args [as 别名]
def test_args_bind(self):
r = PsDashRunner.create_from_args(['-b', '10.0.0.1'])
self.assertEqual(r.app.config['PSDASH_BIND_HOST'], '10.0.0.1')
示例6:
# 需要导入模块: from psdash.run import PsDashRunner [as 别名]
# 或者: from psdash.run.PsDashRunner import create_from_args [as 别名]
from psdash.run import PsDashRunner
application = PsDashRunner.create_from_args().app
application.config['SECRET_KEY'] = 'ravioliravioligivemetheformuoli'
application.psdash.logs.add_patterns(['/var/log/nginx/access.log'])