Gentoo Archives: gentoo-portage-dev

From: Matt Turner <mattst88@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Matt Turner <mattst88@g.o>
Subject: [gentoo-portage-dev] [PATCH gentoolkit 2/3] ekeyword: Fix unit test
Date: Mon, 21 Dec 2020 03:25:34
Message-Id: 20201221032526.306727-2-mattst88@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH gentoolkit 1/3] ekeyword: Rename unit test so that it runs by Matt Turner
1 arch_status changed from a Dict[str] to Dict[Tuple[str, str]], but these
2 bits of test data were not updated. Update the examples while we're here
3 (e.g. arm64 is stable with stable profiles now).
4
5 Fixes: 459cfba47d25 (ekeyword: Use now-common load_profile_data() from eshowkw)
6 Signed-off-by: Matt Turner <mattst88@g.o>
7 ---
8 pym/gentoolkit/ekeyword/test_ekeyword.py | 38 +++++++++++-------------
9 1 file changed, 18 insertions(+), 20 deletions(-)
10
11 diff --git a/pym/gentoolkit/ekeyword/test_ekeyword.py b/pym/gentoolkit/ekeyword/test_ekeyword.py
12 index 3d23585..12a0b54 100755
13 --- a/pym/gentoolkit/ekeyword/test_ekeyword.py
14 +++ b/pym/gentoolkit/ekeyword/test_ekeyword.py
15 @@ -165,28 +165,26 @@ class TestProcessKeywords(unittest.TestCase):
16 ekeyword.Op(None, 'all', None),
17 )
18 arch_status = {
19 - 'alpha': None,
20 - 'arm': 'stable',
21 - 'arm64': 'exp',
22 - 'm68k': 'dev',
23 + 'alpha': ('stable', '~arch'),
24 + 'arm': ('stable', 'arch'),
25 + 'm68k': ('exp', '~arch'),
26 + 's390': ('exp', 'arch'),
27 }
28 - self._test('* ~alpha ~arm ~arm64 ~m68k ~mips ~arm-linux', ops,
29 - '* ~alpha arm ~arm64 ~m68k ~mips ~arm-linux', arch_status)
30 + self._test('* ~alpha ~arm ~m68k ~mips ~s390 ~arm-linux', ops,
31 + '* ~alpha arm ~m68k ~mips s390 ~arm-linux', arch_status)
32
33 def testAllUnstable(self):
34 ops = (
35 ekeyword.Op('~', 'all', None),
36 )
37 arch_status = {
38 - 'alpha': None,
39 - 'arm': 'stable',
40 - 'arm64': 'exp',
41 - 'm68k': 'dev',
42 - 's390': 'dev',
43 - 'sh': 'dev',
44 + 'alpha': ('stable', '~arch'),
45 + 'arm': ('stable', 'arch'),
46 + 'm68k': ('exp', '~arch'),
47 + 's390': ('exp', 'arch'),
48 }
49 - self._test('-* ~* * alpha arm arm64 m68k arm-linux', ops,
50 - '-* ~* * ~alpha ~arm ~arm64 ~m68k ~arm-linux', arch_status)
51 + self._test('-* ~* * alpha arm m68k s390 arm-linux', ops,
52 + '-* ~* * ~alpha ~arm ~m68k ~s390 ~arm-linux', arch_status)
53
54 def testAllMultiUnstableStable(self):
55 ops = (
56 @@ -194,13 +192,13 @@ class TestProcessKeywords(unittest.TestCase):
57 ekeyword.Op(None, 'all', None),
58 )
59 arch_status = {
60 - 'alpha': None,
61 - 'arm': 'stable',
62 - 'arm64': 'exp',
63 - 'm68k': 'dev',
64 + 'alpha': ('stable', '~arch'),
65 + 'arm': ('stable', 'arch'),
66 + 'm68k': ('exp', '~arch'),
67 + 's390': ('exp', 'arch'),
68 }
69 - self._test('-* ~* * alpha arm arm64 m68k', ops,
70 - '-* ~* * ~alpha arm ~arm64 ~m68k', arch_status)
71 + self._test('-* ~* * alpha arm m68k s390', ops,
72 + '-* ~* * ~alpha arm ~m68k s390', arch_status)
73
74 def testAllDisabled(self):
75 """Make sure ~all does not change -arch to ~arch"""
76 --
77 2.26.2