MCPcopy
hub / github.com/saltstack/salt / test_install_multiple_editable

Function test_install_multiple_editable

tests/pytests/unit/modules/test_pip.py:176–208  ·  view source on GitHub ↗
(python_binary, venv_target)

Source from the content-addressed store, hash-verified

174
175
176def test_install_multiple_editable(python_binary, venv_target):
177 editables = [
178 "git+https://github.com/saltstack/istr.git@v1.0.1#egg=iStr",
179 "git+https://github.com/saltstack/salt-testing.git#egg=SaltTesting",
180 ]
181
182 expected = [*python_binary, "install", *venv_target]
183 for item in editables:
184 expected.extend(["--editable", item])
185
186 # Passing editables as a list
187 mock = MagicMock(return_value={"retcode": 0, "stdout": ""})
188 with patch.dict(pip.__salt__, {"cmd.run_all": mock}):
189 pip.install(editable=editables)
190 mock.assert_called_with(
191 expected,
192 saltenv="base",
193 runas=None,
194 use_vt=False,
195 python_shell=False,
196 )
197
198 # Passing editables as a comma separated list
199 mock = MagicMock(return_value={"retcode": 0, "stdout": ""})
200 with patch.dict(pip.__salt__, {"cmd.run_all": mock}):
201 pip.install(editable=",".join(editables))
202 mock.assert_called_with(
203 expected,
204 saltenv="base",
205 runas=None,
206 use_vt=False,
207 python_shell=False,
208 )
209
210
211def test_install_multiple_pkgs_and_editables(python_binary, venv_target):

Callers

nothing calls this directly

Calls 2

extendMethod · 0.45
installMethod · 0.45

Tested by

no test coverage detected