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