summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlec Warner <antarus@gentoo.org>2007-01-11 19:24:07 +0000
committerAlec Warner <antarus@gentoo.org>2007-01-11 19:24:07 +0000
commitd4609cec2231469d82d13ce9bb62e986d99ff87c (patch)
tree96b07bb6a7faca3c597765d41e1892f606d60224 /tests
parent98a8516eff55814b51891e25879b6f2884895fbc (diff)
downloadportage-d4609cec2231469d82d13ce9bb62e986d99ff87c.tar.gz
portage-d4609cec2231469d82d13ce9bb62e986d99ff87c.tar.bz2
portage-d4609cec2231469d82d13ce9bb62e986d99ff87c.zip
get_operator tests
svn path=/main/trunk/; revision=5558
Diffstat (limited to 'tests')
-rw-r--r--tests/portage_dep/test_get_operator.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/portage_dep/test_get_operator.py b/tests/portage_dep/test_get_operator.py
new file mode 100644
index 000000000..d3f5792b6
--- /dev/null
+++ b/tests/portage_dep/test_get_operator.py
@@ -0,0 +1,27 @@
+# test_match_from_list.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 get_operator
+
+class GetOperator(TestCase):
+
+ def testGetOperator(self):
+
+ tests = [ ( "~", "~" ), ( "=", "=" ), ( ">", ">" ),
+ ( ">=", ">=" ), ( "<=", "<=" ) , ( "", None ) ]
+
+ testCP = "sys-apps/portage"
+
+ for test in tests:
+ result = get_operator( test[0] + testCP )
+ self.failIf( result != test[1],
+ msg="Expected %s from get_operator( %s ), got \
+ %s" % ( test[1], test[0] + testCP, result ) )
+
+ result = get_operator( "=sys-apps/portage*" )
+ self.failIf( result != "=*",
+ msg="Expected %s from get_operator( %s ), got \
+ %s" % ( "=*", "=sys-apps/portage*", result ) )