From 11fff7a865f25fccf9d24086773b7410b9778cac Mon Sep 17 00:00:00 2001 From: Alec Warner Date: Thu, 1 Feb 2007 05:46:41 +0000 Subject: [PATCH] increase test coverage to cover slots, uncovering a few corner cases that need fixing svn path=/main/trunk/; revision=5856 --- tests/portage/dep/test_dep_getcpv.py | 3 ++- tests/portage/dep/test_get_operator.py | 15 ++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/portage/dep/test_dep_getcpv.py b/tests/portage/dep/test_dep_getcpv.py index 857a408a3..f1561ed78 100644 --- a/tests/portage/dep/test_dep_getcpv.py +++ b/tests/portage/dep/test_dep_getcpv.py @@ -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: diff --git a/tests/portage/dep/test_get_operator.py b/tests/portage/dep/test_get_operator.py index 28485e0f0..b41fab0d5 100644 --- a/tests/portage/dep/test_get_operator.py +++ b/tests/portage/dep/test_get_operator.py @@ -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 , "=*" ) -- 2.26.2