|
2 | 2 | import shutil |
3 | 3 | import sys |
4 | 4 | from pathlib import Path |
5 | | -from unittest.mock import Mock, patch |
6 | 5 |
|
7 | 6 | import pytest |
8 | | -import yaml |
9 | 7 |
|
10 | | -from komodo import cli |
11 | 8 | from komodo.cli import cli_main |
12 | 9 | from tests import _get_test_root |
13 | 10 |
|
@@ -237,54 +234,3 @@ def count_release_folders_to_be_deleted() -> int: |
237 | 234 | assert count_release_folders_to_be_deleted() == len(test_dirs) |
238 | 235 | cli_main() |
239 | 236 | assert count_release_folders_to_be_deleted() == 0 |
240 | | - |
241 | | - |
242 | | -def test_komodo_shims_is_installed_at_the_end(tmpdir): |
243 | | - (Path(tmpdir) / "release.yml").write_text( |
244 | | - "komodo-shims: 1.0.0\npython: 3-builtin\ntreelib: 1.7.0", encoding="utf-8" |
245 | | - ) |
246 | | - repo = { |
247 | | - "python": { |
248 | | - "3-builtin": { |
249 | | - "make": "pip", # because why not |
250 | | - "maintainer": "foo", |
251 | | - } |
252 | | - }, |
253 | | - "treelib": { |
254 | | - "1.7.0": { |
255 | | - "source": "pypi", |
256 | | - "make": "pip", |
257 | | - "maintainer": "bar", |
258 | | - "depends": ["python"], |
259 | | - } |
260 | | - }, |
261 | | - "komodo-shims": { |
262 | | - "1.0.0": {"source": "pypi", "make": "pip", "maintainer": "com"} |
263 | | - }, |
264 | | - } |
265 | | - (Path(tmpdir) / "repository.yml").write_text(yaml.dump(repo), encoding="utf-8") |
266 | | - sys.argv = [ |
267 | | - "kmd", |
268 | | - "--workspace", |
269 | | - str(tmpdir), |
270 | | - str(tmpdir / "release.yml"), |
271 | | - str(tmpdir / "repository.yml"), |
272 | | - "--release", |
273 | | - "a_komodo_release_with_shims", |
274 | | - "--prefix", |
275 | | - str(tmpdir), |
276 | | - ] |
277 | | - |
278 | | - mocked_shell = Mock(return_value=b"") |
279 | | - mocked_fetch = Mock(return_value={}) |
280 | | - with patch.object(cli, "shell", mocked_shell), patch.object( |
281 | | - cli, "fetch", mocked_fetch |
282 | | - ): |
283 | | - cli_main() |
284 | | - pip_install_calls = [ |
285 | | - shell_call |
286 | | - for shell_call in mocked_shell.mock_calls |
287 | | - if "'pip', 'install " in str(shell_call.args[0]) |
288 | | - ] |
289 | | - assert len(pip_install_calls) == 3 |
290 | | - assert "komodo-shims" in str(pip_install_calls[-1]) |
0 commit comments