summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Luther <SebastianLuther@gmx.de>2010-09-10 22:18:21 +0200
committerZac Medico <zmedico@gentoo.org>2010-09-10 13:39:54 -0700
commit6099b2436c3142281a9b66edc8cb294f6589e813 (patch)
tree289aed14155e69dd52d0b9c4c5c14a9ec06e547a
parent4835264c3c8bc0cdc93a8e0a66db821e6478ccd6 (diff)
downloadportage-6099b2436c3142281a9b66edc8cb294f6589e813.tar.gz
portage-6099b2436c3142281a9b66edc8cb294f6589e813.tar.bz2
portage-6099b2436c3142281a9b66edc8cb294f6589e813.zip
Tests: ebuild/test_config: Make sure -atoms in package.mask work as PMS wants it
-rw-r--r--pym/portage/tests/ebuild/test_config.py69
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()