Line 0
Link Here
|
0 |
- |
1 |
# Copyright 2014 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 OnlydepsTestCase(TestCase): |
8 |
|
9 |
def testOnlydeps(self): |
10 |
ebuilds = { |
11 |
"app-misc/A-1": { |
12 |
"EAPI": "5", |
13 |
"SLOT": "1", |
14 |
"DEPEND": "|| ( app-misc/B app-misc/A:1 )" |
15 |
}, |
16 |
"app-misc/A-2": { |
17 |
"EAPI": "5", |
18 |
"SLOT": "2", |
19 |
}, |
20 |
"app-misc/B-0": { |
21 |
"EAPI": "5", |
22 |
} |
23 |
} |
24 |
|
25 |
installed = { |
26 |
"app-misc/A-2": { |
27 |
"EAPI": "5", |
28 |
"SLOT": "2", |
29 |
} |
30 |
} |
31 |
|
32 |
test_cases = ( |
33 |
# bug 524916 - direct circular dep should not pull |
34 |
# in an onlydeps node when possible |
35 |
ResolverPlaygroundTestCase( |
36 |
["app-misc/A:1"], |
37 |
success = True, |
38 |
options = { "--onlydeps": True }, |
39 |
mergelist = ["app-misc/B-0"]), |
40 |
) |
41 |
|
42 |
playground = ResolverPlayground(ebuilds=ebuilds, |
43 |
installed=installed, debug=False) |
44 |
try: |
45 |
for test_case in test_cases: |
46 |
playground.run_TestCase(test_case) |
47 |
self.assertEqual(test_case.test_success, True, test_case.fail_msg) |
48 |
finally: |
49 |
playground.cleanup() |