summaryrefslogtreecommitdiffstats
path: root/tests/portage_util/test_stackDictList.py
diff options
context:
space:
mode:
authorAlec Warner <antarus@gentoo.org>2007-01-10 13:45:27 +0000
committerAlec Warner <antarus@gentoo.org>2007-01-10 13:45:27 +0000
commit68cee055aba91242c664f4c59606ffce73f4ce37 (patch)
treebf1bf099aef4556b7ddc1ec6246febea82d8606c /tests/portage_util/test_stackDictList.py
parentd8b1ff0c9f48c7ada77b58ea3d4229cc028ac776 (diff)
downloadportage-68cee055aba91242c664f4c59606ffce73f4ce37.tar.gz
portage-68cee055aba91242c664f4c59606ffce73f4ce37.tar.bz2
portage-68cee055aba91242c664f4c59606ffce73f4ce37.zip
split out util tests
svn path=/main/trunk/; revision=5529
Diffstat (limited to 'tests/portage_util/test_stackDictList.py')
-rw-r--r--tests/portage_util/test_stackDictList.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/portage_util/test_stackDictList.py b/tests/portage_util/test_stackDictList.py
new file mode 100644
index 000000000..e6442ce43
--- /dev/null
+++ b/tests/portage_util/test_stackDictList.py
@@ -0,0 +1,19 @@
+# test_stackDictList.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
+
+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.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])) )