Refactor template management to use database.

This commit is contained in:
grossmj committed 2021-03-28 11:15:08 +10:30
1 parent b417bc4dec
commit d730c591b3
20 files changed
+1704 -1535

No files matched your search

-27
View File
@@ -445,33 +445,6 @@ def test_appliances(controller, tmpdir):
elif j["name"] == "My Appliance":
assert not j["builtin"]
def test_load_templates(controller):
controller._settings = {}
controller.template_manager.load_templates()
assert "Cloud" in [template.name for template in controller.template_manager.templates.values()]
assert "VPCS" in [template.name for template in controller.template_manager.templates.values()]
for template in controller.template_manager.templates.values():
if template.name == "VPCS":
assert template._settings["properties"] == {"base_script_file": "vpcs_base_config.txt"}
# UUID should not change when you run again the function
for template in controller.template_manager.templates.values():
if template.name == "Test":
qemu_uuid = template.id
elif template.name == "Cloud":
cloud_uuid = template.id
controller.template_manager.load_templates()
for template in controller.template_manager.templates.values():
if template.name == "Test":
assert qemu_uuid == template.id
elif template.name == "Cloud":
assert cloud_uuid == template.id
@pytest.mark.asyncio
async def test_autoidlepc(controller):