diff options
author | Alec Warner <antarus@gentoo.org> | 2007-01-10 13:35:03 +0000 |
---|---|---|
committer | Alec Warner <antarus@gentoo.org> | 2007-01-10 13:35:03 +0000 |
commit | be41793f50c29aa6c0d17a8616ce214b71d81e0a (patch) | |
tree | dbfe6b7453a13e047319f3f3254aaa16c9f5a95e /tests/portage_util | |
parent | 2b95943f707bec5fcf4f360cdb26e372392fa177 (diff) | |
download | portage-be41793f50c29aa6c0d17a8616ce214b71d81e0a.tar.gz portage-be41793f50c29aa6c0d17a8616ce214b71d81e0a.tar.bz2 portage-be41793f50c29aa6c0d17a8616ce214b71d81e0a.zip |
Take Genone's suggestion and break the modules up into module oriented fashion. Tests for portage.py go in portage/ and so on and so forth...
svn path=/main/trunk/; revision=5525
Diffstat (limited to 'tests/portage_util')
-rw-r--r-- | tests/portage_util/__init__.py | 5 | ||||
-rw-r--r-- | tests/portage_util/test_util.py | 39 |
2 files changed, 44 insertions, 0 deletions
diff --git a/tests/portage_util/__init__.py b/tests/portage_util/__init__.py new file mode 100644 index 000000000..ede012f66 --- /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: __init__.py 5522 2007-01-10 12:30:05Z antarus $ + diff --git a/tests/portage_util/test_util.py b/tests/portage_util/test_util.py new file mode 100644 index 000000000..e16da6c1d --- /dev/null +++ b/tests/portage_util/test_util.py @@ -0,0 +1,39 @@ +# test_vercmp.py -- Portage Unit Testing Functionality +# Copyright 2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: test_vercmp.py 5213 2006-12-08 00:12:41Z antarus $ + +from unittest import TestCase, TestLoader + +class UtilTestCase(TestCase): + + def testUniqueArray(self): + pass + + def testVarexpand(self): + pass + + def testStackLists(self): + pass + + def testStackDicts(self): + pass + + 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.failUnless(stack_dictlist([test[0],test[1]],incremental=test[2]) == test[3], + msg="%s and %s combined, was expecting: %s and got: %s" % (test[0],test[1],test[3], + stack_dictlist([test[0],test[1]],incremental=test[2])) ) + + def testNormalizePath(self): + + from portage_util import normalize_path + path = "///foo/bar/baz" + good = "/foo/bar/baz" + self.failUnless(normalize_path(path) == good, msg="NormalizePath(%s) failed to produce %s" % (path, good)) + |