test_merge_order: test hard buildtime blockers
authorZac Medico <zmedico@gentoo.org>
Sat, 21 May 2011 04:01:31 +0000 (21:01 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 26 May 2011 03:43:15 +0000 (20:43 -0700)
pym/portage/tests/resolver/test_merge_order.py

index e7f1aa48c05ff12773b39996f39cdf3a898f7369..45890af23e4f07b949e25aa09a1e57100090b5a8 100644 (file)
@@ -10,6 +10,13 @@ class MergeOrderTestCase(TestCase):
        def testMergeOrder(self):
                ebuilds = {
                        "app-misc/blocker-buildtime-a-1" : {},
+                       "app-misc/blocker-buildtime-unbuilt-a-1" : {
+                               "DEPEND" : "!app-misc/installed-blocker-a",
+                       },
+                       "app-misc/blocker-buildtime-unbuilt-hard-a-1" : {
+                               "EAPI"   : "2",
+                               "DEPEND" : "!!app-misc/installed-blocker-a",
+                       },
                        "app-misc/blocker-runtime-a-1" : {},
                        "app-misc/blocker-runtime-hard-a-1" : {},
                        "app-misc/circ-post-runtime-a-1": {
@@ -75,6 +82,20 @@ class MergeOrderTestCase(TestCase):
                                ["app-misc/blocker-runtime-a"],
                                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.
+                       # TODO: distinguish between install/uninstall tasks in mergelist
+                       ResolverPlaygroundTestCase(
+                               ["app-misc/blocker-buildtime-unbuilt-a"],
+                               success = True,
+                               mergelist = ["app-misc/blocker-buildtime-unbuilt-a-1", "app-misc/installed-blocker-a-1", "!app-misc/installed-blocker-a"]),
+                       # We have a hard buildtime blocker against an installed
+                       # package that will not resolve automatically (unless
+                       # the option requested in bug 250286 is implemented).
+                       ResolverPlaygroundTestCase(
+                               ["app-misc/blocker-buildtime-unbuilt-hard-a"],
+                               success = False,
+                               mergelist = ['app-misc/blocker-buildtime-unbuilt-hard-a-1', '!!app-misc/installed-blocker-a']),
                        # An installed package has a hard runtime blocker that
                        # will not resolve automatically (unless the option
                        # requested in bug 250286 is implemented).