increase test coverage to cover slots, uncovering a few corner cases that need fixing
authorAlec Warner <antarus@gentoo.org>
Thu, 1 Feb 2007 05:46:41 +0000 (05:46 -0000)
committerAlec Warner <antarus@gentoo.org>
Thu, 1 Feb 2007 05:46:41 +0000 (05:46 -0000)
svn path=/main/trunk/; revision=5856

tests/portage/dep/test_dep_getcpv.py
tests/portage/dep/test_get_operator.py

index 857a408a3c7e65e4695a7030309966f66e01664e..f1561ed7827419a1b31998b7b55a498e088e438c 100644 (file)
@@ -18,7 +18,8 @@ class DepGetCPV(TestCase):
                bad_prefix_ops = [ ">~", "<~", "~>", "~<" ]
                postfix_ops = [ "*", "" ]
 
-               cpvs = ["sys-apps/portage"]
+               cpvs = ["sys-apps/portage", "sys-apps/portage-2.1", "sys-apps/portage-2.1:",
+                               "sys-apps/portage-2.1:2"]
 
                for cpv in cpvs:
                        for prefix in prefix_ops:
index 28485e0f0bf618f3a95f39d1fbdc701cc4dd54fa..b41fab0d5120fe2613bd3c67ed224ec84aebc4f7 100644 (file)
@@ -16,11 +16,16 @@ class GetOperator(TestCase):
                          ( ">~", ">" ), ("~<", "~"), ( "=~", "=" ),
                          ( "=>", "=" ), ("=<", "=") ]
 
-               testCP = "sys-apps/portage"
-
-               for test in tests:
-                       result = get_operator( test[0] + testCP )
-                       self.assertEqual( result, test[1] )
+               test_cpvs = ["sys-apps/portage","sys-apps/portage-2.1"]
+               slots = [ None,"1","linux-2.5.6" ]
+               for cpv in test_cpvs:
+                       for test in tests:
+                               for slot in slots:
+                                       atom = cpv[:]
+                                       if slot:
+                                               atom += ":" + slot
+                                       result = get_operator( test[0] + atom )
+                                       self.assertEqual( result, test[1] )
 
                result = get_operator( "=sys-apps/portage*" )
                self.assertEqual( result , "=*" )