aboutsummaryrefslogtreecommitdiffstats
path: root/pym/portage/tests/util/test_stackDictList.py
blob: 25a723c692c48435fc6c0d8607faaf668cb40c96 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# test_stackDictList.py -- Portage Unit Testing Functionality
# Copyright 2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

from portage.tests import TestCase

class StackDictListTestCase(TestCase):

	def testStackDictList(self):
		from portage.util import stack_dictlist

		tests = [
			({'a': 'b'}, {'x': 'y'}, False, {'a': ['b'], 'x': ['y']}),
			({'KEYWORDS': ['alpha', 'x86']}, {'KEYWORDS': ['-*']}, True, {}),
			({'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])