本文整理汇总了Python中tests.mocks.EngineEmul.unify_config方法的典型用法代码示例。如果您正苦于以下问题:Python EngineEmul.unify_config方法的具体用法?Python EngineEmul.unify_config怎么用?Python EngineEmul.unify_config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tests.mocks.EngineEmul
的用法示例。
在下文中一共展示了EngineEmul.unify_config方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestEngine
# 需要导入模块: from tests.mocks import EngineEmul [as 别名]
# 或者: from tests.mocks.EngineEmul import unify_config [as 别名]
#.........这里部分代码省略.........
for executor in self.obj.provisioning.executors:
executor.env.set({"TEST_MODE": "files"})
self.obj.run()
self.obj.post_process()
def test_unknown_module(self):
configs = [
RESOURCES_DIR + "json/gatling.json",
self.paths
]
self.obj.configure(configs)
self.obj.config["provisioning"] = "unknown"
self.obj.config["modules"]["unknown"] = BetterDict()
self.assertRaises(TaurusConfigError, self.obj.prepare)
def test_null_aggregator(self):
self.obj.config.merge({
"execution": [{
"scenario": {
"requests": [{"url": "http://example.com/"}],
}}],
"settings": {
"aggregator": None,
"default-executor": "jmeter",
},
"modules": {
"local": "bzt.modules.provisioning.Local",
"jmeter": {"class": "tests.modules.jmeter.MockJMeterExecutor",
"protocol-handlers": {"http": "bzt.jmx.http.HTTPProtocolHandler"}},
}})
self.obj.unify_config()
self.obj.prepare()
def test_yaml_multi_docs(self):
configs = [
RESOURCES_DIR + "yaml/multi-docs.yml",
self.paths
]
self.obj.configure(configs)
self.obj.prepare()
self.assertEqual(len(self.obj.config["execution"]), 2)
def test_json_format_regression(self):
configs = [
RESOURCES_DIR + "json/json-but-not-yaml.json"
]
self.obj.configure(configs)
self.obj.prepare()
def test_invalid_format(self):
configs = [
RESOURCES_DIR + "jmeter-dist-3.0.zip"
]
self.assertRaises(TaurusConfigError, lambda: self.obj.configure(configs))
def test_included_configs(self):
configs = [
RESOURCES_DIR + "yaml/included-level1.yml",
]
self.obj.configure(configs)
self.assertTrue(self.obj.config["level1"])
self.assertTrue(self.obj.config["level2"])
self.assertTrue(self.obj.config["level3"])