Skip to content

Commit c10e51d

Browse files
committed
[dist] Update test_distribution to latest Distribution changes
1 parent eb23232 commit c10e51d

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
@@ -210,22 +210,33 @@ def test_get_distributions_error_ndk_api_mismatch(
210210
distribution with the same `name` but different `ndk_api`.
211211
"""
212212
expected_dist = Distribution.get_distribution(
213-
self.ctx, name="test_prj", recipes=["python3", "kivy"]
213+
self.ctx,
214+
name="test_prj",
215+
recipes=["python3", "kivy"],
214216
)
217+
expected_dist.ndk_api = 22
218+
expected_dist.android_api = 27
215219
mock_get_dists.return_value = [expected_dist]
216220
mock_glob.return_value = ["sdl2-python3"]
217221

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

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

0 commit comments

Comments
 (0)