summaryrefslogtreecommitdiffstats
path: root/pym/portage/tests/dep
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-08-27 15:13:29 -0700
committerZac Medico <zmedico@gentoo.org>2012-08-27 15:13:29 -0700
commitac843c3df2210566b559dc57c5fb657e20933a58 (patch)
treede282b9f699d5917a0cd4929a2e11e1d6dc86894 /pym/portage/tests/dep
parentfbf6518406ddb79a999b7d1230046ad93adc445d (diff)
downloadportage-ac843c3df2210566b559dc57c5fb657e20933a58.tar.gz
portage-ac843c3df2210566b559dc57c5fb657e20933a58.tar.bz2
portage-ac843c3df2210566b559dc57c5fb657e20933a58.zip
EAPI 5: REQUIRED_USE at-most-one-of ?? operator
See bug #354219 and the PMS patch: http://git.overlays.gentoo.org/gitweb/?p=proj/pms.git;a=commit;h=1c2dff2df2305aff88a734e3a2716de1bb69f3b6
Diffstat (limited to 'pym/portage/tests/dep')
-rw-r--r--pym/portage/tests/dep/testCheckRequiredUse.py16
-rw-r--r--pym/portage/tests/dep/test_get_required_use_flags.py4
2 files changed, 18 insertions, 2 deletions
diff --git a/pym/portage/tests/dep/testCheckRequiredUse.py b/pym/portage/tests/dep/testCheckRequiredUse.py
index 54791e016..d85ad92d3 100644
--- a/pym/portage/tests/dep/testCheckRequiredUse.py
+++ b/pym/portage/tests/dep/testCheckRequiredUse.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from portage.tests import TestCase
@@ -18,6 +18,11 @@ class TestCheckRequiredUse(TestCase):
( "^^ ( a b )", ["a"], ["a", "b"], True),
( "^^ ( a b )", ["b"], ["a", "b"], True),
( "^^ ( a b )", ["a", "b"], ["a", "b"], False),
+ ( "?? ( a b )", ["a", "b"], ["a", "b"], False),
+ ( "?? ( a b )", ["a"], ["a", "b"], True),
+ ( "?? ( a b )", ["b"], ["a", "b"], True),
+ ( "?? ( a b )", [], ["a", "b"], True),
+ ( "?? ( )", [], [], True),
( "^^ ( || ( a b ) c )", [], ["a", "b", "c"], False),
( "^^ ( || ( a b ) c )", ["a"], ["a", "b", "c"], True),
@@ -102,6 +107,10 @@ class TestCheckRequiredUse(TestCase):
( "^^ ( || ( a b ) ) ^^ ( b c ) )", [], ["a", "b", "c"]),
)
+ test_cases_xfail_eapi = (
+ ( "?? ( a b )", [], ["a", "b"], "4"),
+ )
+
for required_use, use, iuse, expected in test_cases:
self.assertEqual(bool(check_required_use(required_use, use, iuse.__contains__)), \
expected, required_use + ", USE = " + " ".join(use))
@@ -110,6 +119,11 @@ class TestCheckRequiredUse(TestCase):
self.assertRaisesMsg(required_use + ", USE = " + " ".join(use), \
InvalidDependString, check_required_use, required_use, use, iuse.__contains__)
+ for required_use, use, iuse, eapi in test_cases_xfail_eapi:
+ self.assertRaisesMsg(required_use + ", USE = " + " ".join(use), \
+ InvalidDependString, check_required_use, required_use, use,
+ iuse.__contains__, eapi=eapi)
+
def testCheckRequiredUseFilterSatisfied(self):
"""
Test filtering of satisfied parts of REQUIRED_USE,
diff --git a/pym/portage/tests/dep/test_get_required_use_flags.py b/pym/portage/tests/dep/test_get_required_use_flags.py
index 06f81106a..90e096c78 100644
--- a/pym/portage/tests/dep/test_get_required_use_flags.py
+++ b/pym/portage/tests/dep/test_get_required_use_flags.py
@@ -1,4 +1,4 @@
-# Copyright 2010 Gentoo Foundation
+# Copyright 2010-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from portage.tests import TestCase
@@ -13,6 +13,8 @@ class TestCheckRequiredUse(TestCase):
("|| ( a b c )", ["a", "b", "c"]),
("^^ ( a b c )", ["a", "b", "c"]),
+ ("?? ( a b c )", ["a", "b", "c"]),
+ ("?? ( )", []),
("|| ( a b ^^ ( d e f ) )", ["a", "b", "d", "e", "f"]),
("^^ ( a b || ( d e f ) )", ["a", "b", "d", "e", "f"]),