From d1180871de0e79c20899926b4ced690ce9e156fb Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Tue, 9 Aug 2022 09:12:39 -0400 Subject: [PATCH] fix unit test --- tests/test_web/test_submit.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/test_web/test_submit.py b/tests/test_web/test_submit.py index fb7aa57e..fae3e0f1 100644 --- a/tests/test_web/test_submit.py +++ b/tests/test_web/test_submit.py @@ -17,7 +17,7 @@ from module_build_service.common.utils import (mmd_to_str, load_mmd, from module_build_service.scheduler.db_session import db_session from module_build_service.web.submit import ( get_prefixed_version, submit_module_build, submit_module_build_from_yaml, - process_module_context_configuration, _apply_side_tag, + process_module_context_configuration, _apply_xmd_params, ) from tests import ( scheduler_init_data, @@ -317,20 +317,26 @@ data: """ return load_mmd(yaml_str) - def test_apply_side_tag(self): + def test_apply_xmd_params(self): """ - Test that the side tag option is correctly added into the xmd + Test that key params are correctly added into the xmd """ mmd = self.get_mmd() side_tag = "SIDETAG" - _apply_side_tag(mmd, {"side_tag": side_tag}) + params = { + "side_tag": "SIDETAG", + "rpm_component_ref_overrides": {"pkg": "f4836ea0"}, + "branch": "f37", + } + _apply_xmd_params(mmd, params) xmd = mmd.get_xmd() - assert xmd["mbs"]["side_tag"] == side_tag + for key in params: + assert xmd["mbs"][key] == params[key] def test_apply_side_tag_no_option(self): """ - Test that the xmd is unchanged when option not given + Test that the xmd is unchanged when no relevant options are given """ mmd = self.get_mmd() xmd_orig = mmd.get_xmd()