From db3521bdd5c57a20a8f3bf04a84fcd65430e39c9 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 21 May 2011 15:15:42 -0700 Subject: test_merge_order: test solve blocker no-overlap --- pym/portage/tests/resolver/test_merge_order.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'pym') diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py index 62d16d98b..bae9bcadb 100644 --- a/pym/portage/tests/resolver/test_merge_order.py +++ b/pym/portage/tests/resolver/test_merge_order.py @@ -17,6 +17,9 @@ class MergeOrderTestCase(TestCase): "EAPI" : "2", "DEPEND" : "!!app-misc/installed-blocker-a", }, + "app-misc/blocker-update-order-a-1" : { + "RDEPEND" : ">=app-misc/installed-old-version-blocks-a-2" + }, "app-misc/blocker-runtime-a-1" : {}, "app-misc/blocker-runtime-hard-a-1" : {}, "app-misc/circ-buildtime-a-0": {}, @@ -81,6 +84,10 @@ class MergeOrderTestCase(TestCase): "DEPEND" : "!app-misc/blocker-buildtime-a", "RDEPEND" : "!app-misc/blocker-runtime-a !!app-misc/blocker-runtime-hard-a", }, + "app-misc/installed-old-version-blocks-a-1" : { + "RDEPEND" : "!app-misc/installed-old-version-blocks-a", + }, + "app-misc/installed-old-version-blocks-a-2" : {}, "app-misc/some-app-a-1": { "RDEPEND": "app-misc/circ-runtime-a app-misc/circ-runtime-b", }, @@ -109,6 +116,9 @@ class MergeOrderTestCase(TestCase): "DEPEND" : "!app-misc/blocker-buildtime-a", "RDEPEND" : "!app-misc/blocker-runtime-a !!app-misc/blocker-runtime-hard-a", }, + "app-misc/installed-old-version-blocks-a-1" : { + "RDEPEND" : "!app-misc/installed-old-version-blocks-a", + }, } test_cases = ( @@ -163,6 +173,15 @@ class MergeOrderTestCase(TestCase): ["app-misc/blocker-buildtime-a"], success = True, mergelist = ["app-misc/blocker-buildtime-a-1"]), + # We're installing a package that an old version of + # an installed package blocks. However, an update is + # available to the old package. The old package should + # be updated first, in order to solve the blocker without + # any need for blocking packages to temporarily overlap. + ResolverPlaygroundTestCase( + ["app-misc/blocker-update-order-a"], + success = True, + mergelist = ["app-misc/installed-old-version-blocks-a-2", "app-misc/blocker-update-order-a-1"]), # installed package has runtime blocker that # should cause it to be uninstalled # TODO: distinguish between install/uninstall tasks in mergelist @@ -171,7 +190,10 @@ class MergeOrderTestCase(TestCase): success = True, mergelist = ["app-misc/blocker-runtime-a-1", "app-misc/installed-blocker-a-1", "!app-misc/blocker-runtime-a"]), # We have a soft buildtime blocker against an installed - # package that should cause it to be uninstalled. + # package that should cause it to be uninstalled. Note that with + # soft blockers, the blocking packages are allowed to temporarily + # overlap. This allows any essential programs/libraries provided + # by both packages to be available at all times. # TODO: distinguish between install/uninstall tasks in mergelist ResolverPlaygroundTestCase( ["app-misc/blocker-buildtime-unbuilt-a"], -- cgit v1.2.3-1-g7c22