From 3f289cb5dae80a801fb5b46a719939929ef454f9 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 14 Nov 2012 09:41:38 -0800 Subject: [PATCH] test_update_dbentry: test bug #367215 --- .../tests/update/test_update_dbentry.py | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/pym/portage/tests/update/test_update_dbentry.py b/pym/portage/tests/update/test_update_dbentry.py index 0d4c5a02d..39b8e665d 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 = { -- 2.26.2