diff options
Diffstat (limited to 'tests/portage/dep/test_get_operator.py')
-rw-r--r-- | tests/portage/dep/test_get_operator.py | 26 |
1 files changed, 26 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..28485e0f0 --- /dev/null +++ b/tests/portage/dep/test_get_operator.py @@ -0,0 +1,26 @@ +# 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$ + +from unittest import TestCase +from portage.dep import get_operator + +class GetOperator(TestCase): + + def testGetOperator(self): + + # get_operator does not validate operators + tests = [ ( "~", "~" ), ( "=", "=" ), ( ">", ">" ), + ( ">=", ">=" ), ( "<=", "<=" ) , ( "", None ), + ( ">~", ">" ), ("~<", "~"), ( "=~", "=" ), + ( "=>", "=" ), ("=<", "=") ] + + testCP = "sys-apps/portage" + + for test in tests: + result = get_operator( test[0] + testCP ) + self.assertEqual( result, test[1] ) + + result = get_operator( "=sys-apps/portage*" ) + self.assertEqual( result , "=*" ) |