summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorSebastian Luther <SebastianLuther@gmx.de>2010-08-10 23:38:55 +0200
committerZac Medico <zmedico@gentoo.org>2010-08-10 22:31:02 -0700
commitc8c410b254e3316a69499157d0db2e68bb17ba14 (patch)
tree67606309f000ebf26bfc35e93dca75c022b87956 /pym
parenta7f75239b5ffe51e714d71660d0e7b8a00a30ee4 (diff)
downloadportage-c8c410b254e3316a69499157d0db2e68bb17ba14.tar.gz
portage-c8c410b254e3316a69499157d0db2e68bb17ba14.tar.bz2
portage-c8c410b254e3316a69499157d0db2e68bb17ba14.zip
Tests: Add tests for portage.dep.dep_opconvert
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/tests/dep/testStandalone.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/pym/portage/tests/dep/testStandalone.py b/pym/portage/tests/dep/testStandalone.py
index a5d661cc3..f018902e5 100644
--- a/pym/portage/tests/dep/testStandalone.py
+++ b/pym/portage/tests/dep/testStandalone.py
@@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
from portage.tests import TestCase
-from portage.dep import cpvequal, flatten
+from portage.dep import cpvequal, dep_opconvert, flatten
from portage.exception import PortageException
class TestStandalone(TestCase):
@@ -48,3 +48,15 @@ class TestStandalone(TestCase):
for not_flat, flat in test_cases:
self.assertEqual(flatten(not_flat), flat)
+
+ def testDep_opconvert(self):
+
+ test_cases = (
+ ( [], [] ),
+ ( ["blah", "||", ["foo", "bar", "baz"]], ["blah", ["||", "foo", "bar", "baz"]] ),
+ ( [["a", "b"], "||", ["c", "d", "e"]], [["a", "b"], ["||", "c", "d", "e"]] ),
+ ( ["||", ["a", "b"], "||", ["c", "d", "e"]], [["||", "a", "b"], ["||", "c", "d", "e"]] ),
+ )
+
+ for orig, expected in test_cases:
+ self.assertEqual(dep_opconvert(orig), expected)