mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-04 11:20:00 +08:00
Merge #697 Fix the transitive dependency resolving to include only active modules.
This commit is contained in:
@@ -127,6 +127,9 @@ def get_variant_dict(data):
|
||||
if 'release' in data:
|
||||
result['variant_release'] = data['release']
|
||||
|
||||
if 'active' in data:
|
||||
result['active'] = data['active']
|
||||
|
||||
if not result:
|
||||
raise ValueError("Couldn't get variant_dict from %s" % data)
|
||||
|
||||
|
||||
@@ -51,6 +51,24 @@ class TestPDCModule(unittest.TestCase):
|
||||
def tearDown(self):
|
||||
self.vcr.__exit__()
|
||||
|
||||
def test_get_variant_dict_module_dict_active(self):
|
||||
"""
|
||||
Tests that "active" is honored by get_variant_dict(...).
|
||||
"""
|
||||
dep = {
|
||||
'name': "platform",
|
||||
'version': "master",
|
||||
'active': True,
|
||||
}
|
||||
expected = {
|
||||
'active': True,
|
||||
'variant_id': 'platform',
|
||||
'variant_version': 'master'
|
||||
}
|
||||
|
||||
variant_dict = mbs_pdc.get_variant_dict(dep)
|
||||
self.assertEqual(variant_dict, expected)
|
||||
|
||||
def test_get_module_simple_as_dict(self):
|
||||
query = {'name': 'testmodule', 'version': 'master'}
|
||||
result = mbs_pdc.get_module(self.pdc, query)
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user