fix doc typo; more test fiddling
authorAlec Warner <antarus@gentoo.org>
Thu, 1 Feb 2007 18:26:04 +0000 (18:26 -0000)
committerAlec Warner <antarus@gentoo.org>
Thu, 1 Feb 2007 18:26:04 +0000 (18:26 -0000)
svn path=/main/trunk/; revision=5862

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

index d194f3d12e79eb083e8bfdda537b59d4ed7cfc6d..e82942e47f44a5cbbc4c22c7fa8dad9de5ca6ad2 100644 (file)
@@ -18,7 +18,7 @@
 # "a? ( b? ( z ) ) -- Valid
 #
 
-import re,  sys, types
+import re, sys, types
 import portage.exception
 from portage.exception import InvalidData, InvalidAtom
 from portage.versions import catpkgsplit, catsplit, pkgcmp, pkgsplit, ververify
@@ -341,7 +341,7 @@ def dep_getusedeps( depend ):
        Pull a listing of USE Dependencies out of a dep atom.
        
        Example usage:
-               >>> dep_getusedeps('app-misc/test:3[foo][-bar]
+               >>> dep_getusedeps('app-misc/test:3[foo][-bar]')
                ['foo','-bar']
        
        @param depend: The depstring to process
index f9bca5ee6e36cfeaf02c208310eff3091cca34ef..59152e057f5960fe1dd9e89fcb416da8bd69edcf 100644 (file)
@@ -47,3 +47,8 @@ def getTests( path, base_path ):
                except ImportError:
                        raise
        return result
+
+test_cpvs = ['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'] ]
index c16632c94aff77e27babba0d7d40b204c262c98f..d191d43ccc5d27ab16f03b12f160d051e5cee152 100644 (file)
@@ -6,20 +6,20 @@
 from unittest import TestCase
 from portage.dep import dep_getusedeps
 
+import sys
+from portage.tests import test_cpvs, test_slots, test_versions, test_usedeps
+
 class DepGetUseDeps(TestCase):
        """ A simple testcase for dep_getusedeps
        """
 
        def testDepGetUseDeps(self):
 
-               useflags = [ '', 'foo', '-bar', ['baz','bar'], ['baz','-bar'] ]
-               cpvs = [ "sys-apps/portage" ]
-               slots = [ None, "0","1","linux-sources-2.5.7","randomstring" ]
-               versions = [ None, "2.1.1", "2.1.1-r2"]
-               for mycpv in cpvs:
-                       for version in versions:
-                               for slot in slots:
-                                       for use in useflags:
+
+               for mycpv in test_cpvs:
+                       for version in test_versions:
+                               for slot in test_slots:
+                                       for use in test_usedeps:
                                                cpv = mycpv[:]
                                                if version:
                                                        cpv += version