本文整理匯總了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'])