示例#1
0
 def test_diff_downgrade(self):
     a1 = MockPackage('a', '1', deb, arch = 'i386')
     a2 = MockPackage('a', '2', deb, arch = 'i386')
     list1 = [ a2 ]
     list2 = [ a1 ]
     diffs = iter_diffs(list1, list2)
     expected = Set([ ('downgrade', a2, a1) ])
     self.assert_equals_long(expected, Set(diffs))
示例#2
0
 def test_diff_remove(self):
     a = MockPackage('a', '1', deb, arch = 'i386')
     b = MockPackage('b', '1', deb, arch = 'i386')
     list1 = [ a, b]
     list2 = []
     diffs = iter_diffs(list1, list2)
     expected = Set([ ('drop', a, None),
                      ('drop', b, None) ])
     self.assert_equals_long(expected, Set(diffs))
示例#3
0
 def test_diff_same(self):
     a = MockPackage('a', '1', deb, arch = 'i386')
     b = MockPackage('b', '1', deb, arch = 'i386')
     list1 = [ a, b ]
     list2 = list1[:]
     list2.reverse()
     diffs = iter_diffs(list1, list2)
     expected = Set([ ('unchanged', a, a),
                      ('unchanged', b, b) ])
     self.assert_equals_long(expected, Set(diffs))
示例#4
0
 def test_diff_with_distractions(self):
     a = MockPackage('a', '1', deb, arch = 'i386')
     b = MockPackage('b', '1', deb, arch = 'i386')
     a_arm = MockPackage('a', '1', deb, arch = 'arm')
     c = MockPackage('c', '1', deb, arch = 'i386')
     list1 = [ a, b ]
     list2 = list1[:]
     list2.reverse()
     list2.append(c)
     list1.append(a_arm)
     diffs = iter_diffs(list1, list2)
     expected = Set([ ('unchanged', a, a),
                      ('unchanged', b, b),
                      ('add', c, None),
                      ('drop', a_arm, None) ])
     diffs = list(diffs)
     diffs.sort()
     expected = list(expected)
     expected.sort()
     self.assert_equals_long(expected, diffs)