1 # Copyright 2010-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
4 from portage.tests import TestCase
5 from portage.tests.resolver.ResolverPlayground import ResolverPlayground, ResolverPlaygroundTestCase
7 class SimpleResolverTestCase(TestCase):
11 "dev-libs/A-1": { "KEYWORDS": "x86" },
12 "dev-libs/A-2": { "KEYWORDS": "~x86" },
15 "app-misc/Z-1": { "DEPEND": "|| ( app-misc/Y ( app-misc/X app-misc/W ) )", "RDEPEND": "" },
16 "app-misc/Y-1": { "KEYWORDS": "~x86" },
26 ResolverPlaygroundTestCase(["dev-libs/A"], success = True, mergelist = ["dev-libs/A-1"]),
27 ResolverPlaygroundTestCase(["=dev-libs/A-2"], options = { "--autounmask": 'n' }, success = False),
29 ResolverPlaygroundTestCase(
31 options = {"--noreplace": True},
34 ResolverPlaygroundTestCase(
36 options = {"--noreplace": True},
39 ResolverPlaygroundTestCase(
41 options = {"--update": True},
43 mergelist = ["dev-libs/B-1.2"]),
45 ResolverPlaygroundTestCase(
48 mergelist = ["app-misc/W-1", "app-misc/X-1", "app-misc/Z-1"]),
51 playground = ResolverPlayground(ebuilds=ebuilds, installed=installed)
53 for test_case in test_cases:
54 playground.run_TestCase(test_case)
55 self.assertEqual(test_case.test_success, True, test_case.fail_msg)