From: Sebastian Luther Date: Fri, 10 Sep 2010 20:18:21 +0000 (+0200) Subject: Tests: ebuild/test_config: Make sure -atoms in package.mask work as PMS wants it X-Git-Tag: v2.2_rc80~15 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6099b2436c3142281a9b66edc8cb294f6589e813;p=portage.git Tests: ebuild/test_config: Make sure -atoms in package.mask work as PMS wants it --- diff --git a/pym/portage/tests/ebuild/test_config.py b/pym/portage/tests/ebuild/test_config.py index fa711bee4..0ac68ac1f 100644 --- a/pym/portage/tests/ebuild/test_config.py +++ b/pym/portage/tests/ebuild/test_config.py @@ -6,7 +6,7 @@ from portage import os from portage.package.ebuild.config import config from portage.package.ebuild._config.LicenseManager import LicenseManager from portage.tests import TestCase -from portage.tests.resolver.ResolverPlayground import ResolverPlayground +from portage.tests.resolver.ResolverPlayground import ResolverPlayground, ResolverPlaygroundTestCase class ConfigTestCase(TestCase): @@ -103,3 +103,70 @@ class ConfigTestCase(TestCase): finally: portage.util.noiselimit = 0 playground.cleanup() + + def testPackageMaskOrder(self): + + ebuilds = { + "dev-libs/A-1": { }, + "dev-libs/B-1": { }, + "dev-libs/C-1": { }, + "dev-libs/D-1": { }, + "dev-libs/E-1": { }, + } + + repo_config = { + "package.mask": + ( + "dev-libs/A", + "dev-libs/C", + ), + } + + profile = { + "package.mask": + ( + "-dev-libs/A", + "dev-libs/B", + "-dev-libs/B", + "dev-libs/D", + ), + } + + user_config = { + "package.mask": + ( + "-dev-libs/C", + "-dev-libs/D", + "dev-libs/E", + ), + } + + test_cases = ( + ResolverPlaygroundTestCase( + ["dev-libs/A"], + success = False), + ResolverPlaygroundTestCase( + ["dev-libs/B"], + success = True, + mergelist = ["dev-libs/B-1"]), + ResolverPlaygroundTestCase( + ["dev-libs/C"], + success = True, + mergelist = ["dev-libs/C-1"]), + ResolverPlaygroundTestCase( + ["dev-libs/D"], + success = True, + mergelist = ["dev-libs/D-1"]), + ResolverPlaygroundTestCase( + ["dev-libs/E"], + success = False), + ) + + playground = ResolverPlayground(ebuilds=ebuilds, repo_config=repo_config, \ + profile=profile, user_config=user_config) + try: + for test_case in test_cases: + playground.run_TestCase(test_case) + self.assertEqual(test_case.test_success, True, test_case.fail_msg) + finally: + playground.cleanup()