diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-05-22 12:43:03 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-05-22 12:43:03 -0700 |
commit | 480d1104c6deacb4ae19aefffebb7db51b992391 (patch) | |
tree | b7b7782633a5830ff8d94b85dbd0598445bed596 | |
parent | d0a8b0bdfeeb406f459ee460f0df3b1b3360ddf1 (diff) | |
download | portage-480d1104c6deacb4ae19aefffebb7db51b992391.tar.gz portage-480d1104c6deacb4ae19aefffebb7db51b992391.tar.bz2 portage-480d1104c6deacb4ae19aefffebb7db51b992391.zip |
test_merge_order: test many-to-one blocks
-rw-r--r-- | pym/portage/tests/resolver/ResolverPlayground.py | 5 | ||||
-rw-r--r-- | pym/portage/tests/resolver/test_merge_order.py | 17 |
2 files changed, 14 insertions, 8 deletions
diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py index 39576f1ae..6a8e3c18c 100644 --- a/pym/portage/tests/resolver/ResolverPlayground.py +++ b/pym/portage/tests/resolver/ResolverPlayground.py @@ -528,8 +528,9 @@ class ResolverPlaygroundTestCase(object): continue new_expected.append(set()) for cpv in obj: - a = Atom("="+cpv, allow_repo=True) - new_expected[-1].add(a.cpv) + if cpv[:1] != "!": + cpv = Atom("="+cpv, allow_repo=True).cpv + new_expected[-1].add(cpv) expected = new_expected if self.ignore_mergelist_order and got is not None: got = set(got) diff --git a/pym/portage/tests/resolver/test_merge_order.py b/pym/portage/tests/resolver/test_merge_order.py index fdbfcb54d..2df3a9963 100644 --- a/pym/portage/tests/resolver/test_merge_order.py +++ b/pym/portage/tests/resolver/test_merge_order.py @@ -19,6 +19,7 @@ class MergeOrderTestCase(TestCase): }, "app-misc/blocker-update-order-a-1" : {}, "app-misc/blocker-runtime-a-1" : {}, + "app-misc/blocker-runtime-b-1" : {}, "app-misc/blocker-runtime-hard-a-1" : {}, "app-misc/circ-buildtime-a-0": {}, "app-misc/circ-buildtime-a-1": { @@ -80,7 +81,7 @@ class MergeOrderTestCase(TestCase): "app-misc/installed-blocker-a-1" : { "EAPI" : "2", "DEPEND" : "!app-misc/blocker-buildtime-a", - "RDEPEND" : "!app-misc/blocker-runtime-a !!app-misc/blocker-runtime-hard-a", + "RDEPEND" : "!app-misc/blocker-runtime-a !app-misc/blocker-runtime-b !!app-misc/blocker-runtime-hard-a", }, "app-misc/installed-old-version-blocks-a-1" : { "RDEPEND" : "!app-misc/blocker-update-order-a", @@ -112,7 +113,7 @@ class MergeOrderTestCase(TestCase): "app-misc/installed-blocker-a-1" : { "EAPI" : "2", "DEPEND" : "!app-misc/blocker-buildtime-a", - "RDEPEND" : "!app-misc/blocker-runtime-a !!app-misc/blocker-runtime-hard-a", + "RDEPEND" : "!app-misc/blocker-runtime-a !app-misc/blocker-runtime-b !!app-misc/blocker-runtime-hard-a", }, "app-misc/installed-old-version-blocks-a-1" : { "RDEPEND" : "!app-misc/blocker-update-order-a", @@ -181,13 +182,17 @@ class MergeOrderTestCase(TestCase): success = True, all_permutations = 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 + # The installed package has runtime blockers that + # should cause it to be uninstalled. The uninstall + # task is executed only after blocking packages have + # been merged. # TODO: distinguish between install/uninstall tasks in mergelist ResolverPlaygroundTestCase( - ["app-misc/blocker-runtime-a"], + ["app-misc/blocker-runtime-a", "app-misc/blocker-runtime-b"], success = True, - mergelist = ["app-misc/blocker-runtime-a-1", "app-misc/installed-blocker-a-1", "!app-misc/blocker-runtime-a"]), + all_permutations = True, + ambiguous_merge_order = True, + mergelist = [("app-misc/blocker-runtime-a-1", "app-misc/blocker-runtime-b-1"), "app-misc/installed-blocker-a-1", ("!app-misc/blocker-runtime-a", "!app-misc/blocker-runtime-b")]), # We have a soft buildtime blocker against an installed # package that should cause it to be uninstalled. Note that with # soft blockers, the blocking packages are allowed to temporarily |