本文整理汇总了Python中tests.functional.utils.get_global函数的典型用法代码示例。如果您正苦于以下问题:Python get_global函数的具体用法?Python get_global怎么用?Python get_global使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_global函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_use
def test_use(self):
rally = utils.Rally()
deployment_id = utils.get_global("RALLY_DEPLOYMENT", rally.env)
config = utils.TaskConfig(self._get_sample_task_config())
output = rally(
("task start --task %(task_file)s " "--deployment %(deployment_id)s")
% {"task_file": config.filename, "deployment_id": deployment_id}
)
result = re.search(r"(?P<uuid>[0-9a-f\-]{36}): started", output)
uuid = result.group("uuid")
rally("task use --task %s" % uuid)
current_task = utils.get_global("RALLY_TASK", rally.env)
self.assertEqual(uuid, current_task)
开发者ID:NeCTAR-RC,项目名称:rally,代码行数:13,代码来源:test_cli_task.py
示例2: _start_task_in_new_thread
def _start_task_in_new_thread(self, rally, cfg, report_file):
deployment_id = utils.get_global("RALLY_DEPLOYMENT", rally.env)
config = utils.TaskConfig(cfg)
cmd = (("task start --task %(task_file)s "
"--deployment %(deployment_id)s") %
{"task_file": config.filename,
"deployment_id": deployment_id})
report_path = os.path.join(
os.environ.get("REPORTS_ROOT", "rally-cli-output-files"),
"TaskTestCase", report_file)
task = threading.Thread(target=rally, args=(cmd, ),
kwargs={"report_path": report_path})
task.start()
uuid = None
while not uuid:
if not uuid:
uuid = utils.get_global("RALLY_TASK", rally.env)
time.sleep(0.5)
return task, uuid
开发者ID:gluke77,项目名称:rally,代码行数:19,代码来源:test_cli_task.py
示例3: _test_start_abort_on_sla_failure
def _test_start_abort_on_sla_failure(self, cfg, times):
rally = utils.Rally()
deployment_id = utils.get_global("RALLY_DEPLOYMENT", rally.env)
config = utils.TaskConfig(cfg)
rally(("task start --task %(task_file)s "
"--deployment %(deployment_id)s --abort-on-sla-failure") %
{"task_file": config.filename,
"deployment_id": deployment_id})
results = json.loads(rally("task results"))
iterations_completed = len(results[0]["result"])
self.assertTrue(iterations_completed < times)
开发者ID:gluke77,项目名称:rally,代码行数:11,代码来源:test_cli_task.py
示例4: test_validate_is_invalid
def test_validate_is_invalid(self):
rally = utils.Rally()
deployment_id = utils.get_global("RALLY_DEPLOYMENT", rally.env)
cfg = {"invalid": "config"}
config = utils.TaskConfig(cfg)
self.assertRaises(utils.RallyCliError,
rally,
("task validate --task %(task_file)s "
"--deployment %(deployment_id)s") %
{"task_file": config.filename,
"deployment_id": deployment_id})
开发者ID:gluke77,项目名称:rally,代码行数:11,代码来源:test_cli_task.py
示例5: test_start
def test_start(self):
rally = utils.Rally()
deployment_id = utils.get_global("RALLY_DEPLOYMENT", rally.env)
cfg = self._get_sample_task_config()
config = utils.TaskConfig(cfg)
output = rally(
("task start --task %(task_file)s " "--deployment %(deployment_id)s")
% {"task_file": config.filename, "deployment_id": deployment_id}
)
result = re.search(r"(?P<task_id>[0-9a-f\-]{36}): started", output)
self.assertIsNotNone(result)
开发者ID:NeCTAR-RC,项目名称:rally,代码行数:11,代码来源:test_cli_task.py
示例6: test_use
def test_use(self):
self.rally.env.update(utils.TEST_ENV)
output = self.rally(
"deployment create --name t_create_env1 --fromenv")
uuid = re.search(r"Using deployment: (?P<uuid>[0-9a-f\-]{36})",
output).group("uuid")
self.rally("deployment create --name t_create_env2 --fromenv")
self.rally("deployment use --deployment %s" % uuid)
current_deployment = utils.get_global("RALLY_DEPLOYMENT",
self.rally.env)
self.assertEqual(uuid, current_deployment)
开发者ID:NaliniKrishna,项目名称:Rally,代码行数:11,代码来源:test_cli_deployment.py
注:本文中的tests.functional.utils.get_global函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论