mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-28 04:32:54 +08:00
unit tests
This commit is contained in:
@@ -99,6 +99,33 @@ class TestDBModule:
|
||||
"testmodule", "master", "20170109091357", "78e4a6fd").keys()
|
||||
assert set(result) == expected
|
||||
|
||||
@pytest.mark.parametrize("missing_format", [False, True])
|
||||
def test_get_module_build_dependencies_side_tag(
|
||||
self, missing_format, reuse_component_init_data):
|
||||
"""
|
||||
Test that we get the correct base module tag when a side tag is specified
|
||||
"""
|
||||
platform = models.ModuleBuild.get_by_id(db_session, 1)
|
||||
module = models.ModuleBuild.get_by_id(db_session, 2)
|
||||
mmd = module.mmd()
|
||||
xmd = mmd.get_xmd()
|
||||
side_tag = "SIDETAG"
|
||||
expected = {"module-f28-SIDETAG-build"}
|
||||
xmd["mbs"]["side_tag"] = side_tag
|
||||
mmd.set_xmd(xmd)
|
||||
if missing_format:
|
||||
# remove koji_tag_format from our platform
|
||||
platform_mmd = platform.mmd()
|
||||
platform_xmd = platform_mmd.get_xmd()
|
||||
del platform_xmd["mbs"]["koji_side_tag_format"]
|
||||
platform_mmd.set_xmd(platform_xmd)
|
||||
platform.modulemd = mmd_to_str(mmd)
|
||||
db_session.commit()
|
||||
expected = {"module-f28-build"}
|
||||
resolver = mbs_resolver.GenericResolver.create(db_session, conf, backend="db")
|
||||
result = resolver.get_module_build_dependencies(mmd=mmd).keys()
|
||||
assert set(result) == expected
|
||||
|
||||
def test_get_module_build_dependencies_recursive(self, reuse_component_init_data):
|
||||
"""
|
||||
Tests that the buildrequires are returned when it is two layers deep
|
||||
|
||||
Reference in New Issue
Block a user