def test_compare_repositories_same_categories(self): # Test that the list is correctly sorted by package name as all packages # are in the same category pkglist = compare_repositories(self.derivative_repo, self.target_repo) self.assertEqual(pkglist[0]['name'], 'foopkg') self.assertEqual(pkglist[1]['name'], 'pkg1') self.assertEqual(pkglist[0]['category'], pkglist[2]['category']) self.assertEqual(pkglist[0]['category'], 'older_version')
def test_compare_repositories_different_categories(self): # Test that the list is sorted by category then by name self.add_package('foopkg2', None, '1.0.1') self.add_package('firstpkg', None, '1.0') pkglist = compare_repositories(self.derivative_repo, self.target_repo) self.assertEqual(pkglist[0]['name'], 'foopkg') self.assertEqual(pkglist[1]['name'], 'pkg1') self.assertEqual(pkglist[0]['category'], pkglist[2]['category']) self.assertEqual(pkglist[0]['category'], 'older_version') self.assertEqual(pkglist[3]['category'], 'missing_pkg') self.assertEqual(pkglist[4]['name'], 'foopkg2')