Skip to content

Commit 759475c

Browse files
committed
[dist] Update test_distribution to latest Distribution changes
1 parent 975d7bb commit 759475c

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

tests/test_distribution.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,22 +211,33 @@ def test_get_distributions_error_ndk_api_mismatch(
211211
distribution with the same `name` but different `ndk_api`.
212212
"""
213213
expected_dist = Distribution.get_distribution(
214-
self.ctx, name="test_prj", recipes=["python3", "kivy"]
214+
self.ctx,
215+
name="test_prj",
216+
recipes=["python3", "kivy"],
215217
)
218+
expected_dist.ndk_api = 22
219+
expected_dist.android_api = 27
216220
mock_get_dists.return_value = [expected_dist]
217221
mock_glob.return_value = ["sdl2-python3"]
218222

219223
with self.assertRaises(BuildInterruptingException) as e:
220224
self.setUp_distribution_with_bootstrap(
221225
Bootstrap().get_bootstrap("sdl2", self.ctx),
222226
allow_replace_dist=False,
223-
ndk_api=22,
224227
)
225228
self.assertEqual(
226229
e.exception.args[0],
227-
"Asked for dist with name test_prj with recipes (python3, kivy)"
228-
" and NDK API 22, but a dist with this name already exists and has"
229-
" either incompatible recipes (python3, kivy) or NDK API 21",
230+
"\n\tAsked for dist with name test_prj and:"
231+
"\n\t-> recipes: (python3, kivy)"
232+
"\n\t-> NDK api: (21)"
233+
"\n\t-> android api (27)"
234+
"\n\t-> archs (armeabi, armeabi-v7a, x86, x86_64, arm64-v8a)"
235+
"\n...but a dist with this name already exists and has either "
236+
"incompatible:"
237+
"\n\t-> recipes: (python3, kivy)"
238+
"\n\t-> NDK api: (22)"
239+
"\n\t-> android api (27)"
240+
"\n\t-> archs (armeabi, armeabi-v7a, x86, x86_64, arm64-v8a)",
230241
)
231242

232243
def test_get_distributions_error_extra_dist_dirs(self):
@@ -261,6 +272,9 @@ def test_get_distributions_possible_dists(self, mock_get_dists):
261272
expected_dist = Distribution.get_distribution(
262273
self.ctx, name="test_prj", recipes=["python3", "kivy"]
263274
)
275+
# since we simulate a dist we need to set the recipes in dict format,
276+
# not not the case for the `Distribution.get_distribution` call
277+
expected_dist.recipes = {"python3": "3.7.1", "kivy": "1.10.0"}
264278
mock_get_dists.return_value = [expected_dist]
265279
self.setUp_distribution_with_bootstrap(
266280
Bootstrap().get_bootstrap("sdl2", self.ctx), name="test_prj"

0 commit comments

Comments
 (0)