# "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
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
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'] ]
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