Line 0
Link Here
|
0 |
- |
1 |
# Copyright 2017 Gentoo Foundation |
|
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
|
4 |
from portage.tests import TestCase |
5 |
from portage.tests.resolver.ResolverPlayground import ResolverPlayground, ResolverPlaygroundTestCase |
6 |
|
7 |
class OnlydepsMinimalTestCase(TestCase): |
8 |
|
9 |
def testOnlydepsMinimal(self): |
10 |
ebuilds = { |
11 |
"dev-libs/A-1": { "DEPEND": "dev-libs/B", |
12 |
"RDEPEND": "dev-libs/C", |
13 |
"PDEPEND": "dev-libs/D" }, |
14 |
"dev-libs/B-1": { }, |
15 |
"dev-libs/C-1": { }, |
16 |
"dev-libs/D-1": { }, |
17 |
} |
18 |
installed = { |
19 |
} |
20 |
|
21 |
test_cases = ( |
22 |
ResolverPlaygroundTestCase( |
23 |
["dev-libs/A"], |
24 |
all_permutations = True, |
25 |
success = True, |
26 |
options = { "--onlydeps": True, |
27 |
"--onlydeps-with-rdeps": "y" }, |
28 |
mergelist = ["dev-libs/B-1", |
29 |
"dev-libs/C-1", |
30 |
"dev-libs/D-1"]), |
31 |
ResolverPlaygroundTestCase( |
32 |
["dev-libs/A"], |
33 |
all_permutations = True, |
34 |
success = True, |
35 |
options = { "--onlydeps": True, |
36 |
"--onlydeps-with-rdeps": "n" }, |
37 |
mergelist = ["dev-libs/B-1"]), |
38 |
) |
39 |
|
40 |
playground = ResolverPlayground(ebuilds=ebuilds, |
41 |
installed=installed, debug=False) |
42 |
try: |
43 |
for test_case in test_cases: |
44 |
playground.run_TestCase(test_case) |
45 |
self.assertEqual(test_case.test_success, True, test_case.fail_msg) |
46 |
finally: |
47 |
playground.cleanup() |