* Fix dep_getusedeps() test to work with tuples.
authorZac Medico <zmedico@gentoo.org>
Sun, 25 May 2008 02:20:45 +0000 (02:20 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 25 May 2008 02:20:45 +0000 (02:20 -0000)
* Add test cases for conditional USE deps.

svn path=/main/trunk/; revision=10398

pym/portage/tests/__init__.py
pym/portage/tests/dep/test_dep_getusedeps.py

index 8380b6c31f167b56e26abb3d0a0f8d15f6ecbee3..7ca048b9ac6b0f974374b37447d3080338b56dfb 100644 (file)
@@ -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?') ]
index 30fa7772fae843fbf19986ce3b1960ea6493d639..71b0fe290100809a39bf24138fc9d5db3948ae12 100644 (file)
@@ -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 + "]" ), () )