From cbf8cc5a167980bfc094199ddf781e81eab43e10 Mon Sep 17 00:00:00 2001 From: Alec Warner Date: Thu, 11 Jan 2007 20:20:30 +0000 Subject: [PATCH] getslot tests svn path=/main/trunk/; revision=5562 --- tests/portage_dep/test_dep_getslot.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/portage_dep/test_dep_getslot.py diff --git a/tests/portage_dep/test_dep_getslot.py b/tests/portage_dep/test_dep_getslot.py new file mode 100644 index 000000000..5e18d7cd4 --- /dev/null +++ b/tests/portage_dep/test_dep_getslot.py @@ -0,0 +1,27 @@ +# test_dep_getslot.py -- Portage Unit Testing Functionality +# Copyright 2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: test_atoms.py 5525 2007-01-10 13:35:03Z antarus $ + +from unittest import TestCase +from portage_dep import dep_getslot + +class DepGetSlot(TestCase): + """ A simple testcase for isvalidatom + """ + + def testDepGetSlot(self): + + slot_char = ":" + slots = ( "a", "1.2", "1", "IloveVapier", None ) + cpvs = ["sys-apps/portage"] + + for cpv in cpvs: + for slot in slots: + if slot: + self.assertEqual( dep_getslot( + cpv + slot_char + slot ), slot ) + else: + self.assertEqual( dep_getslot( cpv ), slot ) + + self.assertEqual( dep_getslot( "sys-apps/portage:"), "" ) -- 2.26.2