Fix bugs and poor assumptions.
authorZac Medico <zmedico@gentoo.org>
Sat, 12 Sep 2009 15:06:02 +0000 (15:06 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 12 Sep 2009 15:06:02 +0000 (15:06 -0000)
svn path=/main/trunk/; revision=14227

pym/portage/tests/dep/test_dep_getslot.py

index 61ea815864256ba06f69bc8fcd81b1fb3bc53065..925a03ffc05be0bb44819730c7f25435695e4f28 100644 (file)
@@ -19,13 +19,11 @@ class DepGetSlot(TestCase):
                for cpv in cpvs:
                        for version in versions:
                                for slot in slots:
-                                       mycpv = cpv[:]
+                                       mycpv = cpv
                                        if version:
-                                               cpv += version
-                                       if slot:
+                                               mycpv = '=' + mycpv + '-' + version
+                                       if slot is not None:
                                                self.assertEqual( dep_getslot( 
-                                                       cpv + slot_char + slot ), slot )
+                                                       mycpv + slot_char + slot ), slot )
                                        else:
-                                               self.assertEqual( dep_getslot( cpv ), slot )
-
-               self.assertEqual( dep_getslot( "sys-apps/portage:"), "" )
+                                               self.assertEqual( dep_getslot( mycpv ), slot )