summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlec Warner <antarus@gentoo.org>2007-01-11 20:37:05 +0000
committerAlec Warner <antarus@gentoo.org>2007-01-11 20:37:05 +0000
commit1ab64bdbd50c1591d67b72a790762e8c50a94838 (patch)
tree70ad3b237cb2153eb8196a571fe94e093917334f
parent15532f25132406d2014f108805ddc408a95f9362 (diff)
downloadportage-1ab64bdbd50c1591d67b72a790762e8c50a94838.tar.gz
portage-1ab64bdbd50c1591d67b72a790762e8c50a94838.tar.bz2
portage-1ab64bdbd50c1591d67b72a790762e8c50a94838.zip
isjustname tests
svn path=/main/trunk/; revision=5564
-rw-r--r--tests/portage_dep/test_isjustname.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/portage_dep/test_isjustname.py b/tests/portage_dep/test_isjustname.py
new file mode 100644
index 000000000..a8a4e24be
--- /dev/null
+++ b/tests/portage_dep/test_isjustname.py
@@ -0,0 +1,25 @@
+# test_isjustname.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 isjustname
+
+class IsJustName(TestCase):
+
+ def testIsJustName(self):
+
+ cats = ( "", "sys-apps/", "foo/", "virtual/" )
+ pkgs = ( "portage", "paludis", "pkgcore", "notARealPkg" )
+ vers = ( "", "-2.0-r3", "-1.0_pre2", "-3.1b" )
+
+ for pkg in pkgs:
+ for cat in cats:
+ for ver in vers:
+ if len(ver):
+ self.assertFalse( isjustname( cat + pkg + ver ),
+ msg="isjustname(%s) is True!" % (cat + pkg + ver) )
+ else:
+ self.assertTrue( isjustname( cat + pkg + ver ),
+ msg="isjustname(%s) is False!" % (cat + pkg + ver) )