diff options
author | Alec Warner <antarus@gentoo.org> | 2007-01-27 18:16:08 +0000 |
---|---|---|
committer | Alec Warner <antarus@gentoo.org> | 2007-01-27 18:16:08 +0000 |
commit | 6ac1f119472d2e41650f4cf7a9bdb17a3afda42c (patch) | |
tree | d993452f7ea513226b6fa4f6fd1ce130796a2914 /tests/portage | |
parent | 8a4a1ddb2255979e94ba5dd0148c4bbfd4920e57 (diff) | |
download | portage-6ac1f119472d2e41650f4cf7a9bdb17a3afda42c.tar.gz portage-6ac1f119472d2e41650f4cf7a9bdb17a3afda42c.tar.bz2 portage-6ac1f119472d2e41650f4cf7a9bdb17a3afda42c.zip |
Move tests into new directory structure
svn path=/main/trunk/; revision=5794
Diffstat (limited to 'tests/portage')
-rw-r--r-- | tests/portage/dep/__init__.py | 4 | ||||
-rw-r--r-- | tests/portage/dep/test_dep_getcpv.py | 31 | ||||
-rw-r--r-- | tests/portage/dep/test_dep_getslot.py | 27 | ||||
-rw-r--r-- | tests/portage/dep/test_get_operator.py | 26 | ||||
-rw-r--r-- | tests/portage/dep/test_isjustname.py | 25 | ||||
-rw-r--r-- | tests/portage/dep/test_isvalidatom.py | 36 | ||||
-rw-r--r-- | tests/portage/dep/test_match_from_list.py | 31 | ||||
-rw-r--r-- | tests/portage/news/__init__.py | 4 | ||||
-rw-r--r-- | tests/portage/news/test_NewsItem.py | 83 | ||||
-rw-r--r-- | tests/portage/util/__init__.py | 5 | ||||
-rw-r--r-- | tests/portage/util/test_grabdict.py | 12 | ||||
-rw-r--r-- | tests/portage/util/test_normalizedPath.py | 15 | ||||
-rw-r--r-- | tests/portage/util/test_stackDictList.py | 18 | ||||
-rw-r--r-- | tests/portage/util/test_stackDicts.py | 37 | ||||
-rw-r--r-- | tests/portage/util/test_stackLists.py | 20 | ||||
-rw-r--r-- | tests/portage/util/test_uniqueArray.py | 26 | ||||
-rw-r--r-- | tests/portage/util/test_varExpand.py | 60 | ||||
-rw-r--r-- | tests/portage/versions/__init__.py | 4 | ||||
-rw-r--r-- | tests/portage/versions/test_vercmp.py | 40 |
19 files changed, 504 insertions, 0 deletions
diff --git a/tests/portage/dep/__init__.py b/tests/portage/dep/__init__.py new file mode 100644 index 000000000..a3226c133 --- /dev/null +++ b/tests/portage/dep/__init__.py @@ -0,0 +1,4 @@ +# tests/portage.dep/__init__.py -- Portage Unit Test functionality +# Copyright 2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ diff --git a/tests/portage/dep/test_dep_getcpv.py b/tests/portage/dep/test_dep_getcpv.py new file mode 100644 index 000000000..857a408a3 --- /dev/null +++ b/tests/portage/dep/test_dep_getcpv.py @@ -0,0 +1,31 @@ +# test_dep_getcpv.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 dep_getcpv + +class DepGetCPV(TestCase): + """ A simple testcase for isvalidatom + """ + + def testDepGetCPV(self): + + prefix_ops = ["<", ">", "=", "~", "!", "<=", + ">=", "!=", "!<", "!>", "!~",""] + + bad_prefix_ops = [ ">~", "<~", "~>", "~<" ] + postfix_ops = [ "*", "" ] + + cpvs = ["sys-apps/portage"] + + for cpv in cpvs: + for prefix in prefix_ops: + for postfix in postfix_ops: + self.assertEqual( dep_getcpv( + prefix + cpv + postfix ), cpv ) + for prefix in bad_prefix_ops: + for postfix in postfix_ops: + self.assertNotEqual( dep_getcpv( + prefix + cpv + postfix ), cpv ) diff --git a/tests/portage/dep/test_dep_getslot.py b/tests/portage/dep/test_dep_getslot.py new file mode 100644 index 000000000..7c3004d05 --- /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$ + +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:"), "" ) 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 , "=*" ) diff --git a/tests/portage/dep/test_isjustname.py b/tests/portage/dep/test_isjustname.py new file mode 100644 index 000000000..e419e3f26 --- /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$ + +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) ) diff --git a/tests/portage/dep/test_isvalidatom.py b/tests/portage/dep/test_isvalidatom.py new file mode 100644 index 000000000..d373a52f0 --- /dev/null +++ b/tests/portage/dep/test_isvalidatom.py @@ -0,0 +1,36 @@ +# test_isvalidatom.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 isvalidatom + +class IsValidAtom(TestCase): + """ A simple testcase for isvalidatom + """ + + def testIsValidAtom(self): + + tests = [ ( "sys-apps/portage", True ), + ( "=sys-apps/portage-2.1", True ), + ( "=sys-apps/portage-2.1*", True ), + ( ">=sys-apps/portage-2.1", True ), + ( "<=sys-apps/portage-2.1", True ), + ( ">sys-apps/portage-2.1", True ), + ( "<sys-apps/portage-2.1", True ), + ( "~sys-apps/portage-2.1", True ), + ( ">~cate-gory/foo-1.0", False ), + ( ">~category/foo-1.0", False ), + ( "<~category/foo-1.0", False ), + ( "###cat/foo-1.0", False ), + ( "~sys-apps/portage", False ), + ( "portage", False ) ] + + for test in tests: + if test[1]: + atom_type = "valid" + else: + atom_type = "invalid" + self.assertEqual( bool(isvalidatom( test[0] )), test[1], + msg="isvalidatom(%s) != %s" % ( test[0], test[1] ) ) diff --git a/tests/portage/dep/test_match_from_list.py b/tests/portage/dep/test_match_from_list.py new file mode 100644 index 000000000..4868184a6 --- /dev/null +++ b/tests/portage/dep/test_match_from_list.py @@ -0,0 +1,31 @@ +# 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 match_from_list + +class AtomCmpEqualGlob(TestCase): + """ A simple testcase for =* glob matching + """ + + def testEqualGlobPass(self): + tests = [ ("=sys-apps/portage-45*", "sys-apps/portage-045" ), + ("=sys-fs/udev-1*", "sys-fs/udev-123"), + ("=sys-fs/udev-4*", "sys-fs/udev-456" ) ] + +# I need to look up the cvs syntax +# ("=sys-fs/udev_cvs*","sys-fs/udev_cvs_pre4" ) ] + + for test in tests: + self.assertEqual( len(match_from_list( test[0], [test[1]] )), 1 ) + + def testEqualGlobFail(self): + tests = [ ("=sys-apps/portage-2*", "sys-apps/portage-2.1" ), + ("=sys-apps/portage-2.1*", "sys-apps/portage-2.1.2" ) ] + for test in tests: + try: + self.assertEqual( len( match_from_list( test[0], [test[1]] ) ), 1 ) + except TypeError: # failure is ok here + pass diff --git a/tests/portage/news/__init__.py b/tests/portage/news/__init__.py new file mode 100644 index 000000000..aeaa49195 --- /dev/null +++ b/tests/portage/news/__init__.py @@ -0,0 +1,4 @@ +# tests/portage.news/__init__.py -- Portage Unit Test functionality +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ diff --git a/tests/portage/news/test_NewsItem.py b/tests/portage/news/test_NewsItem.py new file mode 100644 index 000000000..22ef298d4 --- /dev/null +++ b/tests/portage/news/test_NewsItem.py @@ -0,0 +1,83 @@ +# test_NewsItem.py -- Portage Unit Testing Functionality +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: test_varExpand.py 5596 2007-01-12 08:08:53Z antarus $ + +from unittest import TestCase, TestLoader +from portage.news import NewsItem +from portage.const import PROFILE_PATH + +class NewsItemTestCase(TestCase): + + self.fakeItem = """ +Title: YourSQL Upgrades from 4.0 to 4.1 +Author: Ciaran McCreesh <ciaranm@gentoo.org> +Content-Type: text/plain +Posted: 01-Nov-2005 +Revision: 1 +#Display-If-Installed: +#Display-If-Profile: +#Display-If-Arch: + +YourSQL databases created using YourSQL version 4.0 are incompatible +with YourSQL version 4.1 or later. There is no reliable way to +automate the database format conversion, so action from the system +administrator is required before an upgrade can take place. + +Please see the Gentoo YourSQL Upgrade Guide for instructions: + + http://www.gentoo.org/doc/en/yoursql-upgrading.xml + +Also see the official YourSQL documentation: + + http://dev.yoursql.com/doc/refman/4.1/en/upgrading-from-4-0.html + +After upgrading, you should also recompile any packages which link +against YourSQL: + + revdep-rebuild --library=libyoursqlclient.so.12 + +The revdep-rebuild tool is provided by app-portage/gentoolkit. +""" + + from portage import settings + import time + + def testDisplayIfProfile(): + from portage.const import PROFILE_PATH + tmpItem = self.fakeItem.replace("#Display-If-Profile:", "Display-If-Profile: %s" % + os.readlink( PROFILE_PATH ) ) + + item = _processItem(tmpItem) + self.assertTrue( item.isRelevant( os.readlink( PROFILE_PATH ) ), + msg="Expected %s to be relevant, but it was not!" % tmpItem ) + + def testDisplayIfInstalled(): + tmpItem = self.fakeItem.replace("#Display-If-Installed:", "Display-If-Profile: %s" % + "sys-apps/portage" ) + + item = _processItem(tmpItem) + self.assertTrue( item.isRelevant( portage.settings ), + msg="Expected %s to be relevant, but it was not!" % tmpItem ) + + + def testDisplayIfKeyword(): + from portage import settings + tmpItem = self.fakeItem.replace("#Display-If-Keyword:", "Display-If-Keyword: %s" % + settings["ACCEPT_KEYWORDS"].split()[0] ) + + item = _processItem(tmpItem) + self.assertTrue( item.isRelevant( os.readlink( PROFILE_PATH ) ), + msg="Expected %s to be relevant, but it was not!" % tmpItem ) + + + def _processItem( self, item ): + + path = os.path.join( settings["PORTAGE_TMPDIR"], str(time.time()) + f = open( os.path.join( path ) + f.write(item) + f.close + try: + return NewsItem( path, 0 ) + except TypeError: + self.fail("Error while processing news item %s" % path ) diff --git a/tests/portage/util/__init__.py b/tests/portage/util/__init__.py new file mode 100644 index 000000000..9a66903d1 --- /dev/null +++ b/tests/portage/util/__init__.py @@ -0,0 +1,5 @@ +# tests/portage.util/__init__.py -- Portage Unit Test functionality +# Copyright 2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + diff --git a/tests/portage/util/test_grabdict.py b/tests/portage/util/test_grabdict.py new file mode 100644 index 000000000..9f7b58921 --- /dev/null +++ b/tests/portage/util/test_grabdict.py @@ -0,0 +1,12 @@ +# test_grabDict.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, TestLoader +from portage.util import grabdict + +class GrabDictTestCase(TestCase): + + def testGrabDictPass(self): + pass diff --git a/tests/portage/util/test_normalizedPath.py b/tests/portage/util/test_normalizedPath.py new file mode 100644 index 000000000..bd575d266 --- /dev/null +++ b/tests/portage/util/test_normalizedPath.py @@ -0,0 +1,15 @@ +# test_normalizePath.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 + +class NormalizePathTestCase(TestCase): + + def testNormalizePath(self): + + from portage.util import normalize_path + path = "///foo/bar/baz" + good = "/foo/bar/baz" + self.assertEqual(normalize_path(path), good) diff --git a/tests/portage/util/test_stackDictList.py b/tests/portage/util/test_stackDictList.py new file mode 100644 index 000000000..9e7a38ba1 --- /dev/null +++ b/tests/portage/util/test_stackDictList.py @@ -0,0 +1,18 @@ +# test_stackDictList.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 + +class StackDictListTestCase(TestCase): + + def testStackDictList(self): + from portage.util import stack_dictlist + + tests = [ ({'a':'b'},{'x':'y'},False,{'a':['b'],'x':['y']}) ] + tests.append(( {'KEYWORDS':['alpha','x86']},{'KEYWORDS':['-*']},True,{} )) + tests.append(( {'KEYWORDS':['alpha','x86']},{'KEYWORDS':['-x86']},True,{'KEYWORDS':['alpha']} )) + for test in tests: + self.assertEqual( + stack_dictlist([test[0],test[1]],incremental=test[2]), test[3] ) diff --git a/tests/portage/util/test_stackDicts.py b/tests/portage/util/test_stackDicts.py new file mode 100644 index 000000000..9d9637440 --- /dev/null +++ b/tests/portage/util/test_stackDicts.py @@ -0,0 +1,37 @@ +# test_stackDicts.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.util import stack_dicts + + +class StackDictsTestCase(TestCase): + + def testStackDictsPass(self): + + tests = [ ( [ { "a":"b" }, { "b":"c" } ], { "a":"b", "b":"c" }, + False, [], False ), + ( [ { "a":"b" }, { "a":"c" } ], { "a":"b c" }, + True, [], False ), + ( [ { "a":"b" }, { "a":"c" } ], { "a":"b c" }, + False, ["a"], False ), + ( [ { "a":"b" }, None ], { "a":"b" }, + False, [], True ), + ( [ None ], None, False, [], False ), + ( [ None, {}], {}, False, [], True ) ] + + + for test in tests: + result = stack_dicts( test[0], test[2], test[3], test[4] ) + self.assertEqual( result, test[1] ) + + def testStackDictsFail(self): + + tests = [ ( [ None, {} ], None, False, [], True ), + ( [ { "a":"b"}, {"a":"c" } ], { "a":"b c" }, + False, [], False ) ] + for test in tests: + result = stack_dicts( test[0], test[2], test[3], test[4] ) + self.assertNotEqual( result , test[1] ) diff --git a/tests/portage/util/test_stackLists.py b/tests/portage/util/test_stackLists.py new file mode 100644 index 000000000..3fc028323 --- /dev/null +++ b/tests/portage/util/test_stackLists.py @@ -0,0 +1,20 @@ +# test_stackLists.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.util import stack_lists + +class StackListsTestCase(TestCase): + + def testStackLists(self): + + tests = [ ( [ ['a','b','c'], ['d','e','f'] ], ['a','c','b','e','d','f'], False ), + ( [ ['a','x'], ['b','x'] ], ['a','x','b'], False ), + ( [ ['a','b','c'], ['-*'] ], [], True ), + ( [ ['a'], ['-a'] ], [], True ) ] + + for test in tests: + result = stack_lists( test[0], test[2] ) + self.assertEqual( result , test[1] ) diff --git a/tests/portage/util/test_uniqueArray.py b/tests/portage/util/test_uniqueArray.py new file mode 100644 index 000000000..62a315321 --- /dev/null +++ b/tests/portage/util/test_uniqueArray.py @@ -0,0 +1,26 @@ +# test_uniqueArray.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.util import unique_array + +class UniqueArrayTestCase(TestCase): + + def testUniqueArrayPass(self): + """ + test portage.util.uniqueArray() + """ + + import os + + tests = [ ( ["a","a","a",os,os,[],[],[]], ['a',os,[]] ), + ( [1,1,1,2,3,4,4] , [1,2,3,4]) ] + + for test in tests: + result = unique_array( test[0] ) + for item in test[1]: + number = result.count(item) + self.failIf( number is not 1, msg="%s contains %s of %s, \ + should be only 1" % (result, number, item) ) diff --git a/tests/portage/util/test_varExpand.py b/tests/portage/util/test_varExpand.py new file mode 100644 index 000000000..47dc7de2c --- /dev/null +++ b/tests/portage/util/test_varExpand.py @@ -0,0 +1,60 @@ +# test_varExpand.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, TestLoader +from portage.util import varexpand + +class VarExpandTestCase(TestCase): + + def testVarExpandPass(self): + + varDict = { "a":"5", "b":"7", "c":"-5" } + for key in varDict.keys(): + result = varexpand( "$%s" % key, varDict ) + + self.failIf( result != varDict[key], + msg="Got %s != %s, from varexpand( %s, %s )" % \ + ( result, varDict[key], "$%s" % key, varDict ) ) + result = varexpand( "${%s}" % key, varDict ) + self.failIf( result != varDict[key], + msg="Got %s != %s, from varexpand( %s, %s )" % \ + ( result, varDict[key], "${%s}" % key, varDict ) ) + + def testVarExpandDoubleQuotes(self): + + varDict = { "a":"5" } + tests = [ ("\"${a}\"", "5") ] + for test in tests: + result = varexpand( test[0], varDict ) + self.failIf( result != test[1], + msg="Got %s != %s from varexpand( %s, %s )" \ + % ( result, test[1], test[0], varDict ) ) + + def testVarExpandSingleQuotes(self): + + varDict = { "a":"5" } + tests = [ ("\'${a}\'", "${a}") ] + for test in tests: + result = varexpand( test[0], varDict ) + self.failIf( result != test[1], + msg="Got %s != %s from varexpand( %s, %s )" \ + % ( result, test[1], test[0], varDict ) ) + + def testVarExpandFail(self): + + varDict = { "a":"5", "b":"7", "c":"15" } + + testVars = [ "fail" ] + + for var in testVars: + result = varexpand( "$%s" % var, varDict ) + self.failIf( len(result), + msg="Got %s == %s, from varexpand( %s, %s )" \ + % ( result, var, "$%s" % var, varDict ) ) + + result = varexpand( "${%s}" % var, varDict ) + self.failIf( len(result), + msg="Got %s == %s, from varexpand( %s, %s )" \ + % ( result, var, "${%s}" % var, varDict ) ) diff --git a/tests/portage/versions/__init__.py b/tests/portage/versions/__init__.py new file mode 100644 index 000000000..5e5b216fb --- /dev/null +++ b/tests/portage/versions/__init__.py @@ -0,0 +1,4 @@ +# tests/portage.versions/__init__.py -- Portage Unit Test functionality +# Copyright 2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ diff --git a/tests/portage/versions/test_vercmp.py b/tests/portage/versions/test_vercmp.py new file mode 100644 index 000000000..ee3d37741 --- /dev/null +++ b/tests/portage/versions/test_vercmp.py @@ -0,0 +1,40 @@ +# test_vercmp.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.versions import vercmp + +class VerCmpTestCase(TestCase): + """ A simple testCase for portage.versions.vercmp() + """ + + def testVerCmpGreater(self): + + tests = [ ( "6.0", "5.0"), ("5.0","5")] + for test in tests: + self.failIf( vercmp( test[0], test[1] ) <= 0, msg="%s < %s? Wrong!" % (test[0],test[1]) ) + + def testVerCmpLess(self): + """ + pre < alpha < beta < rc < p -> test each of these, they are inductive (or should be..) + """ + tests = [ ( "4.0", "5.0"), ("5", "5.0"), ("1.0_pre2","1.0_p2"), + ("1.0_alpha2", "1.0_p2"),("1.0_alpha1", "1.0_beta1"),("1.0_beta3","1.0_rc3")] + for test in tests: + self.failIf( vercmp( test[0], test[1]) >= 0, msg="%s > %s? Wrong!" % (test[0],test[1])) + + + def testVerCmpEqual(self): + + tests = [ ("4.0", "4.0") ] + for test in tests: + self.failIf( vercmp( test[0], test[1]) != 0, msg="%s != %s? Wrong!" % (test[0],test[1])) + + def testVerNotEqual(self): + + tests = [ ("1","2"),("1.0_alpha","1.0_pre"),("1.0_beta","1.0_alpha"), + ("0", "0.0")] + for test in tests: + self.failIf( vercmp( test[0], test[1]) == 0, msg="%s == %s? Wrong!" % (test[0],test[1])) |