aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-11-14 17:41:38 (GMT)
committerZac Medico <zmedico@gentoo.org>2012-11-14 17:41:38 (GMT)
commit3f289cb5dae80a801fb5b46a719939929ef454f9 (patch)
treecad800e6173205a8f73857a2f96b4ce4b766cd68
parentupdate_dbentry: avoid self-blocker, bug #367215 (diff)
downloadportage-3f289cb5dae80a801fb5b46a719939929ef454f9.zip
portage-3f289cb5dae80a801fb5b46a719939929ef454f9.tar.gz
portage-3f289cb5dae80a801fb5b46a719939929ef454f9.tar.bz2
test_update_dbentry: test bug #367215
-rw-r--r--pym/portage/tests/update/test_update_dbentry.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/pym/portage/tests/update/test_update_dbentry.py b/pym/portage/tests/update/test_update_dbentry.py
index 0d4c5a0..39b8e66 100644
--- a/pym/portage/tests/update/test_update_dbentry.py
+++ b/pym/portage/tests/update/test_update_dbentry.py
@@ -11,6 +11,7 @@ from portage.tests import TestCase
from portage.tests.resolver.ResolverPlayground import ResolverPlayground
from portage.update import update_dbentry
from portage.util import ensure_dirs
+from portage.versions import _pkg_str
from portage._global_updates import _do_global_updates
class UpdateDbentryTestCase(TestCase):
@@ -61,6 +62,50 @@ class UpdateDbentryTestCase(TestCase):
result = update_dbentry(update_cmd, input_str, eapi=eapi)
self.assertEqual(result, output_str)
+
+ def testUpdateDbentryBlockerTestCase(self):
+ """
+ Avoid creating self-blockers for bug #367215.
+ """
+ cases = (
+
+ (("move", Atom("dev-libs/A"), Atom("dev-libs/B")),
+ _pkg_str("dev-libs/B-1", eapi="1", slot="0"),
+ " !dev-libs/A ", " !dev-libs/A "),
+
+ (("move", Atom("dev-libs/A"), Atom("dev-libs/B")),
+ _pkg_str("dev-libs/C-1", eapi="1", slot="0"),
+ " !dev-libs/A ", " !dev-libs/B "),
+
+ (("move", Atom("dev-libs/A"), Atom("dev-libs/B")),
+ _pkg_str("dev-libs/B-1", eapi="1", slot="0"),
+ " !dev-libs/A:0 ", " !dev-libs/A:0 "),
+
+ (("move", Atom("dev-libs/A"), Atom("dev-libs/B")),
+ _pkg_str("dev-libs/C-1", eapi="1", slot="0"),
+ " !dev-libs/A:0 ", " !dev-libs/B:0 "),
+
+ (("move", Atom("dev-libs/A"), Atom("dev-libs/B")),
+ _pkg_str("dev-libs/C-1", eapi="1", slot="0"),
+ " !>=dev-libs/A-1:0 ", " !>=dev-libs/B-1:0 "),
+
+ (("move", Atom("dev-libs/A"), Atom("dev-libs/B")),
+ _pkg_str("dev-libs/B-1", eapi="1", slot="0"),
+ " !>=dev-libs/A-1:0 ", " !>=dev-libs/A-1:0 "),
+
+ (("move", Atom("dev-libs/A"), Atom("dev-libs/B")),
+ _pkg_str("dev-libs/C-1", eapi="1", slot="0"),
+ " !>=dev-libs/A-1 ", " !>=dev-libs/B-1 "),
+
+ (("move", Atom("dev-libs/A"), Atom("dev-libs/B")),
+ _pkg_str("dev-libs/B-1", eapi="1", slot="0"),
+ " !>=dev-libs/A-1 ", " !>=dev-libs/A-1 "),
+
+ )
+ for update_cmd, parent, input_str, output_str in cases:
+ result = update_dbentry(update_cmd, input_str, parent=parent)
+ self.assertEqual(result, output_str)
+
def testUpdateDbentryDbapiTestCase(self):
ebuilds = {