fix unit test

This commit is contained in:
Mike McLean
2022-08-09 09:12:39 -04:00
parent 879e3befae
commit d1180871de

View File

@@ -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()