summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlec Warner <antarus@gentoo.org>2007-01-11 20:20:30 +0000
committerAlec Warner <antarus@gentoo.org>2007-01-11 20:20:30 +0000
commitcbf8cc5a167980bfc094199ddf781e81eab43e10 (patch)
treebbf256ef94331e847940a86b3e322e98bc08a56e
parentbd12043aa5f8945352f9c50d0d7768ddaefea00c (diff)
downloadportage-cbf8cc5a167980bfc094199ddf781e81eab43e10.tar.gz
portage-cbf8cc5a167980bfc094199ddf781e81eab43e10.tar.bz2
portage-cbf8cc5a167980bfc094199ddf781e81eab43e10.zip
getslot tests
svn path=/main/trunk/; revision=5562
-rw-r--r--tests/portage_dep/test_dep_getslot.py27
1 files changed, 27 insertions, 0 deletions
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:"), "" )