From 06b6ca8c388977140fda468d5d1763a2a4b68cba Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 25 May 2008 02:20:45 +0000 Subject: [PATCH] * Fix dep_getusedeps() test to work with tuples. * Add test cases for conditional USE deps. svn path=/main/trunk/; revision=10398 --- pym/portage/tests/__init__.py | 3 ++- pym/portage/tests/dep/test_dep_getusedeps.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pym/portage/tests/__init__.py b/pym/portage/tests/__init__.py index 8380b6c31..7ca048b9a 100644 --- a/pym/portage/tests/__init__.py +++ b/pym/portage/tests/__init__.py @@ -177,4 +177,5 @@ class TextTestRunner(unittest.TextTestRunner): test_cps = ['sys-apps/portage','virtual/portage'] test_versions = ['1.0', '1.0-r1','2.3_p4','1.0_alpha57'] test_slots = [ None, '1','gentoo-sources-2.6.17','spankywashere'] -test_usedeps = ['foo','-bar', ['foo','bar'],['foo','-bar'] ] +test_usedeps = ['foo','-bar', ('foo','bar'), + ('foo','-bar'), ('foo?', '-bar?') ] diff --git a/pym/portage/tests/dep/test_dep_getusedeps.py b/pym/portage/tests/dep/test_dep_getusedeps.py index 30fa7772f..71b0fe290 100644 --- a/pym/portage/tests/dep/test_dep_getusedeps.py +++ b/pym/portage/tests/dep/test_dep_getusedeps.py @@ -24,7 +24,7 @@ class DepGetUseDeps(TestCase): cpv += version if slot: cpv += ":" + slot - if isinstance( use, list ): + if isinstance(use, tuple): for u in use: cpv = cpv + "[" + u + "]" self.assertEqual( dep_getusedeps( @@ -32,7 +32,7 @@ class DepGetUseDeps(TestCase): else: if len(use): self.assertEqual( dep_getusedeps( - cpv + "[" + use + "]" ), [use] ) + cpv + "[" + use + "]" ), (use,) ) else: self.assertEqual( dep_getusedeps( - cpv + "[" + use + "]" ), [] ) + cpv + "[" + use + "]" ), () ) -- 2.26.2