test_merge_order: test circular RDEPEND + PDEPEND
authorZac Medico <zmedico@gentoo.org>
Sat, 21 May 2011 01:00:02 +0000 (18:00 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 21 May 2011 01:00:02 +0000 (18:00 -0700)
pym/portage/tests/resolver/test_merge_order.py

index ada9e73fd36cb28a54e3f508e0ea8f9a8c97e932..9c5d1fe3fedec2cea4ba23813a8822e0bec54b44 100644 (file)
@@ -9,6 +9,12 @@ class MergeOrderTestCase(TestCase):
 
        def testMergeOrder(self):
                ebuilds = {
+                       "app-misc/circ-post-runtime-a-1": {
+                               "PDEPEND": "app-misc/circ-post-runtime-b",
+                       },
+                       "app-misc/circ-post-runtime-b-1": {
+                               "RDEPEND": "app-misc/circ-post-runtime-a",
+                       },
                        "app-misc/circ-runtime-a-1": {
                                "RDEPEND": "app-misc/circ-runtime-b",
                        },
@@ -18,6 +24,9 @@ class MergeOrderTestCase(TestCase):
                        "app-misc/some-app-a-1": {
                                "RDEPEND": "app-misc/circ-runtime-a app-misc/circ-runtime-b",
                        },
+                       "app-misc/some-app-b-1": {
+                               "RDEPEND": "app-misc/circ-post-runtime-a app-misc/circ-post-runtime-b",
+                       },
                }
 
                installed = {
@@ -34,6 +43,13 @@ class MergeOrderTestCase(TestCase):
                                success = True,
                                ambigous_merge_order = True,
                                mergelist = [("app-misc/circ-runtime-b-1", "app-misc/circ-runtime-a-1"), "app-misc/some-app-a-1"]),
+                       # Test optimal merge order for a circular dep that is
+                       # RDEPEND in one direction and PDEPEND in the other.
+                       ResolverPlaygroundTestCase(
+                               ["app-misc/some-app-a"],
+                               success = True,
+                               ambigous_merge_order = True,
+                               mergelist = ["app-misc/circ-post-runtime-a-1", "app-misc/circ-post-runtime-b-1", "app-misc/some-app-b-1"]),
                )
 
                playground = ResolverPlayground(ebuilds=ebuilds, installed=installed)