summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/dep.py4
-rw-r--r--tests/__init__.py5
-rw-r--r--tests/portage/dep/test_dep_getusedeps.py16
3 files changed, 15 insertions, 10 deletions
diff --git a/pym/portage/dep.py b/pym/portage/dep.py
index d194f3d12..e82942e47 100644
--- a/pym/portage/dep.py
+++ b/pym/portage/dep.py
@@ -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
diff --git a/tests/__init__.py b/tests/__init__.py
index f9bca5ee6..59152e057 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -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'] ]
diff --git a/tests/portage/dep/test_dep_getusedeps.py b/tests/portage/dep/test_dep_getusedeps.py
index c16632c94..d191d43cc 100644
--- a/tests/portage/dep/test_dep_getusedeps.py
+++ b/tests/portage/dep/test_dep_getusedeps.py
@@ -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