Keep the 'module_name:[]' in requires unexpanded in generate_expanded_mmds.

This commit is contained in:
Jan Kaluza
2018-04-06 10:47:59 +02:00
parent 6cc577b4b9
commit 836fb9db10
2 changed files with 14 additions and 1 deletions

View File

@@ -279,7 +279,7 @@ def generate_expanded_mmds(session, mmd, raise_if_stream_ambigous=False, default
# Each generated MMD must be new Module object...
# TODO: Use copy method once its in released libmodulemd:
# https://github.com/fedora-modularity/libmodulemd/pull/20
mmd_copy = Modulemd.Module.new_from_string(current_mmd.dumps())
mmd_copy = Modulemd.Module.new_from_string(mmd.dumps())
xmd = glib.from_variant_dict(mmd_copy.get_xmd())
# Requires contain the NSVC representing the input mmd.

View File

@@ -213,6 +213,14 @@ class TestUtilsModuleStreamExpansion:
set([
frozenset(['gtk:1'])
])),
({"gtk": []}, {"gtk": ["1"]}, True,
set([
frozenset(['gtk:1:0:c2', 'platform:f28:0:c10'])
]),
set([
frozenset(['gtk:1'])
])),
])
def test_generate_expanded_mmds_buildrequires(
self, requires, build_requires, stream_ambigous, expected_xmd,
@@ -293,6 +301,11 @@ class TestUtilsModuleStreamExpansion:
frozenset(['foo:1', 'gtk:1']),
])),
({"gtk": [], "foo": []}, {"gtk": ["1"], "foo": ["1"]},
set([
frozenset([]),
])),
])
def test_generate_expanded_mmds_requires(self, requires, build_requires, expected):
self._generate_default_modules()