Add a backtracking test for 'missed updates'. v2.2_rc89
authorZac Medico <zmedico@gentoo.org>
Mon, 4 Oct 2010 01:25:03 +0000 (18:25 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 5 Oct 2010 16:09:43 +0000 (09:09 -0700)
pym/portage/tests/resolver/test_backtracking.py

index 41b6d50b68905ccae1e2b6204b3b9524ed4e13d9..c8d04be8399f20d84a988d179d6c458c9794be7c 100644 (file)
@@ -131,3 +131,37 @@ class BacktrackingTestCase(TestCase):
                                self.assertEqual(test_case.test_success, True, test_case.fail_msg)
                finally:
                        playground.cleanup()
+
+       def testBacktrackMissedUpdates(self):
+               """
+               An update is missed due to a dependency on an older version.
+               """
+
+               ebuilds = {
+                       "dev-libs/A-1": { },
+                       "dev-libs/A-2": { },
+                       "dev-libs/B-1": { "RDEPEND": "<=dev-libs/A-1" },
+                       }
+
+               installed = {
+                       "dev-libs/A-1": { "USE": "" },
+                       "dev-libs/B-1": { "USE": "", "RDEPEND": "<=dev-libs/A-1" },
+                       }
+
+               test_cases = (
+                               ResolverPlaygroundTestCase(
+                                       ["dev-libs/A", "dev-libs/B"],
+                                       options = {'--update' : True, '--deep' : True},
+                                       all_permutations = True,
+                                       mergelist = [],
+                                       success = True),
+                       )
+
+               playground = ResolverPlayground(ebuilds=ebuilds, installed=installed)
+
+               try:
+                       for test_case in test_cases:
+                               playground.run_TestCase(test_case)
+                               self.assertEqual(test_case.test_success, True, test_case.fail_msg)
+               finally:
+                       playground.cleanup()