| 174 | |
| 175 | |
| 176 | def 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 | |
| 211 | def test_install_multiple_pkgs_and_editables(python_binary, venv_target): |