Package portage :: Package tests :: Package resolver :: Module test_depclean_slot_unavailable
[hide private]

Source Code for Module portage.tests.resolver.test_depclean_slot_unavailable

 1  # Copyright 2012 Gentoo Foundation 
 2  # Distributed under the terms of the GNU General Public License v2 
 3   
 4  from portage.tests import TestCase 
 5  from portage.tests.resolver.ResolverPlayground import (ResolverPlayground, 
 6          ResolverPlaygroundTestCase) 
 7   
8 -class DepcleanUnavailableSlotTestCase(TestCase):
9
11 """ 12 Test bug #445506, where we want to remove the slot 13 for which the ebuild is no longer available, even 14 though its version is higher. 15 """ 16 17 ebuilds = { 18 "sys-kernel/gentoo-sources-3.0.53": { 19 "SLOT": "3.0.53", 20 "KEYWORDS": "x86" 21 }, 22 } 23 24 installed = { 25 "sys-kernel/gentoo-sources-3.0.53": { 26 "SLOT": "3.0.53", 27 "KEYWORDS": "x86" 28 }, 29 "sys-kernel/gentoo-sources-3.2.21": { 30 "SLOT": "3.2.21", 31 "KEYWORDS": "x86" 32 }, 33 } 34 35 world = ["sys-kernel/gentoo-sources"] 36 37 test_cases = ( 38 ResolverPlaygroundTestCase( 39 [], 40 options={"--depclean": True}, 41 success=True, 42 cleanlist=["sys-kernel/gentoo-sources-3.2.21"]), 43 ) 44 45 playground = ResolverPlayground(ebuilds=ebuilds, 46 installed=installed, world=world, debug=False) 47 try: 48 for test_case in test_cases: 49 playground.run_TestCase(test_case) 50 self.assertEqual(test_case.test_success, True, test_case.fail_msg) 51 finally: 52 playground.cleanup() 53 54 # Now make the newer version availale and verify that 55 # the lower version is depcleaned. 56 ebuilds.update({ 57 "sys-kernel/gentoo-sources-3.2.21": { 58 "SLOT": "3.2.21", 59 "KEYWORDS": "x86" 60 }, 61 }) 62 63 test_cases = ( 64 ResolverPlaygroundTestCase( 65 [], 66 options={"--depclean": True}, 67 success=True, 68 cleanlist=["sys-kernel/gentoo-sources-3.0.53"]), 69 ) 70 71 playground = ResolverPlayground(ebuilds=ebuilds, 72 installed=installed, world=world, debug=False) 73 try: 74 for test_case in test_cases: 75 playground.run_TestCase(test_case) 76 self.assertEqual(test_case.test_success, True, test_case.fail_msg) 77 finally: 78 playground.cleanup()
79