Merge #697 Fix the transitive dependency resolving to include only active modules.

This commit is contained in:
Ralph Bean
2017-09-18 12:34:45 +00:00
3 changed files with 21 additions and 0 deletions

View File

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

View File

@@ -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.