summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-09-12 15:29:09 +0000
committerZac Medico <zmedico@gentoo.org>2009-09-12 15:29:09 +0000
commit66df844e6366fdc0650b2404bcd9a0e4e6563fe1 (patch)
tree04e9fae237f94e7e055f2bcce2af979dd510bcc4
parentd815bb66640bd8eb2ecb15fead650f38ecbd7a56 (diff)
downloadportage-66df844e6366fdc0650b2404bcd9a0e4e6563fe1.tar.gz
portage-66df844e6366fdc0650b2404bcd9a0e4e6563fe1.tar.bz2
portage-66df844e6366fdc0650b2404bcd9a0e4e6563fe1.zip
Fix bad assumptions.
svn path=/main/trunk/; revision=14229
-rw-r--r--pym/portage/tests/dep/test_dep_getcpv.py35
1 files changed, 15 insertions, 20 deletions
diff --git a/pym/portage/tests/dep/test_dep_getcpv.py b/pym/portage/tests/dep/test_dep_getcpv.py
index a49f4fa6b..893de0c6e 100644
--- a/pym/portage/tests/dep/test_dep_getcpv.py
+++ b/pym/portage/tests/dep/test_dep_getcpv.py
@@ -12,30 +12,25 @@ class DepGetCPV(TestCase):
def testDepGetCPV(self):
- prefix_ops = ["<", ">", "=", "~", "!", "<=",
- ">=", "!=", "!<", "!>", "!~",""]
+ prefix_ops = ["<", ">", "=", "~", "<=",
+ ">=", "!=", "!<", "!>", "!~"]
bad_prefix_ops = [ ">~", "<~", "~>", "~<" ]
- postfix_ops = [ "*", "" ]
+ postfix_ops = [ ("=", "*"), ]
- cpvs = ["sys-apps/portage", "sys-apps/portage-2.1", "sys-apps/portage-2.1",
+ cpvs = ["sys-apps/portage-2.1", "sys-apps/portage-2.1",
"sys-apps/portage-2.1"]
- slots = [None,":",":2"]
+ slots = [None, ":foo", ":2"]
for cpv in cpvs:
for slot in slots:
for prefix in prefix_ops:
- for postfix in postfix_ops:
- if slot:
- self.assertEqual( dep_getcpv(
- prefix + cpv + slot + postfix ), cpv )
- else:
- self.assertEqual( dep_getcpv(
- prefix + cpv + postfix ), cpv )
- for prefix in bad_prefix_ops:
- for postfix in postfix_ops:
- if slot:
- self.assertNotEqual( dep_getcpv(
- prefix + cpv + slot + postfix ), cpv )
- else:
- self.assertNotEqual( dep_getcpv(
- prefix + cpv + postfix ), cpv ) \ No newline at end of file
+ mycpv = prefix + cpv
+ if slot:
+ mycpv += slot
+ self.assertEqual( dep_getcpv( mycpv ), cpv )
+
+ for prefix, postfix in postfix_ops:
+ mycpv = prefix + cpv + postfix
+ if slot:
+ mycpv += slot
+ self.assertEqual( dep_getcpv( mycpv ), cpv )