예제 #1
0
 def test_2(self):
     linked = ['conda-3.19.0',
               'python-2.7.10-2', 'python-2.7.11-0',
               'zlib-1.2.7-1', 'zlib-1.2.8-0', 'zlib-1.2.8-4']
     keep = ['conda-3.19.0', 'python-2.7.11-0']
     self.assertEqual(duplicates_to_remove(linked, keep),
                      ['python-2.7.10-2', 'zlib-1.2.7-1', 'zlib-1.2.8-0'])
예제 #2
0
 def test_2(self):
     linked = ['conda-3.19.0',
               'python-2.7.10-2', 'python-2.7.11-0',
               'zlib-1.2.7-1', 'zlib-1.2.8-0', 'zlib-1.2.8-4']
     keep = ['conda-3.19.0', 'python-2.7.11-0']
     self.assertEqual(duplicates_to_remove(linked, keep),
                      ['python-2.7.10-2', 'zlib-1.2.7-1', 'zlib-1.2.8-0'])
예제 #3
0
 def test_misc(self):
     d1 = 'a-1.3-0'
     self.assertEqual(duplicates_to_remove([], []), [])
     self.assertEqual(duplicates_to_remove([], [d1]), [])
     self.assertEqual(duplicates_to_remove([d1], [d1]), [])
     self.assertEqual(duplicates_to_remove([d1], []), [])
     d2 = 'a-1.4-0'
     self.assertEqual(duplicates_to_remove([d1], [d2]), [])
     li = set([d1, d2])
     self.assertEqual(duplicates_to_remove(li, [d2]), [d1])
     self.assertEqual(duplicates_to_remove(li, [d1]), [d2])
     self.assertEqual(duplicates_to_remove(li, []), [d1])
     self.assertEqual(duplicates_to_remove(li, [d1, d2]), [])
예제 #4
0
 def test_misc(self):
     d1 = 'a-1.3-0'
     self.assertEqual(duplicates_to_remove([], []), [])
     self.assertEqual(duplicates_to_remove([], [d1]), [])
     self.assertEqual(duplicates_to_remove([d1], [d1]), [])
     self.assertEqual(duplicates_to_remove([d1], []), [])
     d2 = 'a-1.4-0'
     self.assertEqual(duplicates_to_remove([d1], [d2]), [])
     li = set([d1, d2])
     self.assertEqual(duplicates_to_remove(li, [d2]), [d1])
     self.assertEqual(duplicates_to_remove(li, [d1]), [d2])
     self.assertEqual(duplicates_to_remove(li, []), [d1])
     self.assertEqual(duplicates_to_remove(li, [d1, d2]), [])
예제 #5
0
 def test_nokeep(self):
     linked = ['python-2.7.10-2', 'python-2.7.11-0', 'python-3.4.3-1']
     self.assertEqual(duplicates_to_remove(linked, []),
                      ['python-2.7.10-2', 'python-2.7.11-0'])
예제 #6
0
 def test_3(self):
     linked = ['python-2.7.10-2', 'python-2.7.11-0', 'python-3.4.3-1']
     keep = ['conda-3.19.0', 'python-2.7.11-0']
     self.assertEqual(duplicates_to_remove(linked, keep),
                      ['python-2.7.10-2', 'python-3.4.3-1'])
예제 #7
0
 def test_0(self):
     linked = ['conda-3.18.8-py27_0', 'python-2.7.11-0', 'zlib-1.2.8-0']
     keep = linked
     self.assertEqual(duplicates_to_remove(linked, keep), [])
예제 #8
0
 def test_nokeep(self):
     linked = ['python-2.7.10-2', 'python-2.7.11-0', 'python-3.4.3-1']
     self.assertEqual(duplicates_to_remove(linked, []),
                      ['python-2.7.10-2', 'python-2.7.11-0'])
예제 #9
0
 def test_3(self):
     linked = ['python-2.7.10-2', 'python-2.7.11-0', 'python-3.4.3-1']
     keep = ['conda-3.19.0', 'python-2.7.11-0']
     self.assertEqual(duplicates_to_remove(linked, keep),
                      ['python-2.7.10-2', 'python-3.4.3-1'])
예제 #10
0
 def test_0(self):
     linked = ['conda-3.18.8-py27_0', 'python-2.7.11-0', 'zlib-1.2.8-0']
     keep = linked
     self.assertEqual(duplicates_to_remove(linked, keep), [])