diff options
-rw-r--r-- | pym/portage/tests/ebuild/test_config.py | 69 |
1 files changed, 68 insertions, 1 deletions
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() |