def test_attr_diff_nosuchattr(): di = DistroInfo('rdo.yml', local_info=common.get_test_info_path('rdoinfo')) info = di.get_info() info2 = copy.deepcopy(info) # Update distgit for nova for pkg in info2['packages']: if pkg['project'] == 'nova': pkg['upstream'] = 'https://opendev.org/openstack/foo' diff = query.attr_diff(info, info2, 'fooattr') assert (len(diff) == 0)
def test_attr_diff_newpkg(): di = DistroInfo('rdo.yml', local_info=common.get_test_info_path('rdoinfo')) info = di.get_info() info2 = copy.deepcopy(info) # Add package newpkg = { 'project': 'newproject', 'name': 'openstack-newproject', 'master-distgit': 'https://github.com/rdo-packages/new-distgit', 'upstream': 'https://opendev.org/openstack/newproject' } info2['packages'].append(newpkg) diff = query.attr_diff(info, info2, 'master-distgit') assert (len(diff) == 1) assert (diff[0][0] == 'openstack-newproject') assert (diff[0][1] == 'https://github.com/rdo-packages/new-distgit')
def test_attr_diff_nochanges(): di = DistroInfo('rdo.yml', local_info=common.get_test_info_path('rdoinfo')) info = di.get_info() info2 = copy.deepcopy(info) diff = query.attr_diff(info, info2, 'upstream') assert (len(diff) == 0)