Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/
Date: Sat, 01 Feb 2020 04:48:05
Message-Id: 1580532456.1419af8b0830af4a93adda4a4b63d6bba8f3deb6.zmedico@gentoo
1 commit: 1419af8b0830af4a93adda4a4b63d6bba8f3deb6
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 31 03:25:26 2020 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 1 04:47:36 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=1419af8b
7
8 Add test case that demonstrates bug 707108
9
10 Bug: https://bugs.gentoo.org/707108
11 Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
12
13 lib/portage/tests/resolver/test_or_choices.py | 123 ++++++++++++++++++++++++++
14 1 file changed, 123 insertions(+)
15
16 diff --git a/lib/portage/tests/resolver/test_or_choices.py b/lib/portage/tests/resolver/test_or_choices.py
17 index a50ad0151..78946ccec 100644
18 --- a/lib/portage/tests/resolver/test_or_choices.py
19 +++ b/lib/portage/tests/resolver/test_or_choices.py
20 @@ -285,6 +285,129 @@ class OrChoicesTestCase(TestCase):
21 playground.debug = False
22 playground.cleanup()
23
24 + def test_python_slot(self):
25 + ebuilds = {
26 +
27 + "dev-lang/python-3.8" : {
28 + "EAPI": "7",
29 + "SLOT": "3.8"
30 + },
31 +
32 + "dev-lang/python-3.7" : {
33 + "EAPI": "7",
34 + "SLOT": "3.7"
35 + },
36 +
37 + "dev-lang/python-3.6" : {
38 + "EAPI": "7",
39 + "SLOT": "3.6"
40 + },
41 +
42 + "app-misc/bar-1" : {
43 + "EAPI": "7",
44 + "IUSE": "python_targets_python3_6 +python_targets_python3_7",
45 + "RDEPEND": "python_targets_python3_7? ( dev-lang/python:3.7 ) python_targets_python3_6? ( dev-lang/python:3.6 )"
46 + },
47 +
48 + "app-misc/foo-1" : {
49 + "EAPI": "7",
50 + "RDEPEND": "|| ( dev-lang/python:3.8 dev-lang/python:3.7 dev-lang/python:3.6 )"
51 + },
52 +
53 + }
54 +
55 + installed = {
56 +
57 + "dev-lang/python-3.7" : {
58 + "EAPI": "7",
59 + "SLOT": "3.7"
60 + },
61 +
62 + "app-misc/bar-1" : {
63 + "EAPI": "7",
64 + "IUSE": "python_targets_python3_6 +python_targets_python3_7",
65 + "USE": "python_targets_python3_7",
66 + "RDEPEND": "dev-lang/python:3.7"
67 + },
68 +
69 + "app-misc/foo-1" : {
70 + "EAPI": "7",
71 + "RDEPEND": "|| ( dev-lang/python:3.8 dev-lang/python:3.7 dev-lang/python:3.6 )"
72 + },
73 +
74 + }
75 +
76 + world = ["app-misc/foo", "app-misc/bar"]
77 +
78 + test_cases = (
79 +
80 + ResolverPlaygroundTestCase(
81 + ["@world"],
82 + options = {"--update": True, "--deep": True},
83 + success = True,
84 + mergelist = ['dev-lang/python-3.8']
85 + ),
86 +
87 + )
88 +
89 + playground = ResolverPlayground(ebuilds=ebuilds,
90 + installed=installed, world=world, debug=False)
91 + try:
92 + for test_case in test_cases:
93 + playground.run_TestCase(test_case)
94 + self.assertEqual(test_case.test_success, True, test_case.fail_msg)
95 + finally:
96 + playground.debug = False
97 + playground.cleanup()
98 +
99 + installed = {
100 +
101 + "dev-lang/python-3.8" : {
102 + "EAPI": "7",
103 + "SLOT": "3.8"
104 + },
105 +
106 + "dev-lang/python-3.7" : {
107 + "EAPI": "7",
108 + "SLOT": "3.7"
109 + },
110 +
111 + "app-misc/bar-1" : {
112 + "EAPI": "7",
113 + "IUSE": "python_targets_python3_6 +python_targets_python3_7",
114 + "USE": "python_targets_python3_7",
115 + "RDEPEND": "dev-lang/python:3.7"
116 + },
117 +
118 + "app-misc/foo-1" : {
119 + "EAPI": "7",
120 + "RDEPEND": "|| ( dev-lang/python:3.8 dev-lang/python:3.7 dev-lang/python:3.6 )"
121 + },
122 +
123 + }
124 +
125 + test_cases = (
126 + # Demonstrate bug 707108, where a new python slot is erroneosly
127 + # removed by emerge --depclean.
128 + ResolverPlaygroundTestCase(
129 + [],
130 + options={"--depclean": True},
131 + success=True,
132 + cleanlist=['dev-lang/python-3.8'],
133 + ),
134 + )
135 +
136 + playground = ResolverPlayground(ebuilds=ebuilds,
137 + installed=installed, world=world, debug=False)
138 + try:
139 + for test_case in test_cases:
140 + playground.run_TestCase(test_case)
141 + self.assertEqual(test_case.test_success, True, test_case.fail_msg)
142 + finally:
143 + playground.debug = False
144 + playground.cleanup()
145 +
146 +
147 class OrChoicesLibpostprocTestCase(TestCase):
148
149 def testOrChoicesLibpostproc(self):