mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-01 18:01:40 +08:00
tests/mmd_resolver: add tests for multi-dependency modules
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
This commit is contained in:
@@ -219,3 +219,104 @@ class TestMMDResolver:
|
||||
])
|
||||
|
||||
assert expanded == expected
|
||||
|
||||
def test_solve_multiple_requires_pairs(self):
|
||||
for mmd in self._default_mmds():
|
||||
self.mmd_resolver.add_modules(mmd)
|
||||
|
||||
app = self._make_mmd(
|
||||
"app:1:0",
|
||||
[{"gtk": ["1"], "foo": ["1"]},
|
||||
{"gtk": ["2"], "foo": ["1", "2"]}])
|
||||
expanded = self.mmd_resolver.solve(app)
|
||||
|
||||
expected = set([
|
||||
frozenset(["app:1:0:1:src",
|
||||
"foo:1:0:c3:x86_64",
|
||||
"gtk:2:0:c5:x86_64",
|
||||
"platform:f29:0:c11:x86_64"]),
|
||||
frozenset(["app:1:0:1:src",
|
||||
"foo:2:0:c5:x86_64",
|
||||
"gtk:2:0:c5:x86_64",
|
||||
"platform:f29:0:c11:x86_64"]),
|
||||
frozenset(["app:1:0:0:src",
|
||||
"foo:1:0:c3:x86_64",
|
||||
"gtk:1:0:c3:x86_64",
|
||||
"platform:f29:0:c11:x86_64"]),
|
||||
frozenset(["app:1:0:1:src",
|
||||
"foo:1:0:c2:x86_64",
|
||||
"gtk:2:0:c4:x86_64",
|
||||
"platform:f28:0:c10:x86_64"]),
|
||||
frozenset(["app:1:0:1:src",
|
||||
"foo:2:0:c4:x86_64",
|
||||
"gtk:2:0:c4:x86_64",
|
||||
"platform:f28:0:c10:x86_64"]),
|
||||
frozenset(["app:1:0:0:src",
|
||||
"foo:1:0:c2:x86_64",
|
||||
"gtk:1:0:c2:x86_64",
|
||||
"platform:f28:0:c10:x86_64"]),
|
||||
])
|
||||
|
||||
assert expanded == expected
|
||||
|
||||
def test_solve_multiple_requires_pairs_buildrequire_platform(self):
|
||||
for mmd in self._default_mmds():
|
||||
self.mmd_resolver.add_modules(mmd)
|
||||
|
||||
app = self._make_mmd(
|
||||
"app:1:0",
|
||||
[{"gtk": ["1"], "foo": ["1"]},
|
||||
{"gtk": ["2"], "foo": ["1", "2"], "platform": ["f28"]}])
|
||||
expanded = self.mmd_resolver.solve(app)
|
||||
|
||||
expected = set([
|
||||
frozenset(["app:1:0:0:src",
|
||||
"foo:1:0:c3:x86_64",
|
||||
"gtk:1:0:c3:x86_64",
|
||||
"platform:f29:0:c11:x86_64"]),
|
||||
frozenset(["app:1:0:1:src",
|
||||
"foo:1:0:c2:x86_64",
|
||||
"gtk:2:0:c4:x86_64",
|
||||
"platform:f28:0:c10:x86_64"]),
|
||||
frozenset(["app:1:0:0:src",
|
||||
"foo:1:0:c2:x86_64",
|
||||
"gtk:1:0:c2:x86_64",
|
||||
"platform:f28:0:c10:x86_64"]),
|
||||
frozenset(["app:1:0:1:src",
|
||||
"foo:2:0:c4:x86_64",
|
||||
"gtk:2:0:c4:x86_64",
|
||||
"platform:f28:0:c10:x86_64"]),
|
||||
])
|
||||
|
||||
assert expanded == expected
|
||||
|
||||
def test_solve_multiple_requires_pairs_multiple_requires(self):
|
||||
for mmd in self._default_mmds_with_multiple_requires():
|
||||
self.mmd_resolver.add_modules(mmd)
|
||||
|
||||
app = self._make_mmd(
|
||||
"app:1:0",
|
||||
[{"gtk": ["1"], "font": ["a"]},
|
||||
{"gtk": ["2"], "font": ["b"]}])
|
||||
expanded = self.mmd_resolver.solve(app)
|
||||
|
||||
expected = set([
|
||||
frozenset(["app:1:0:0:src",
|
||||
"font:a:0:c7:x86_64",
|
||||
"gtk:1:0:c3:x86_64",
|
||||
"platform:f29:0:c11:x86_64"]),
|
||||
frozenset(["app:1:0:1:src",
|
||||
"font:b:0:c8:x86_64",
|
||||
"gtk:2:0:c4:x86_64",
|
||||
"platform:f28:0:c10:x86_64"]),
|
||||
frozenset(["app:1:0:0:src",
|
||||
"font:a:0:c6:x86_64",
|
||||
"gtk:1:0:c2:x86_64",
|
||||
"platform:f28:0:c10:x86_64"]),
|
||||
frozenset(["app:1:0:1:src",
|
||||
"font:b:0:c9:x86_64",
|
||||
"gtk:2:0:c5:x86_64",
|
||||
"platform:f29:0:c11:x86_64"]),
|
||||
])
|
||||
|
||||
assert expanded == expected
|
||||
|
||||
Reference in New Issue
Block a user