def test_ensure_multipass_raises(self, monkeypatch, platform, prompt_installable, snap_which): def which_effect(command: str): if command == "snap" and snap_which: return ["snap"] return None monkeypatch.setattr(shutil, "which", which_effect) with pytest.raises(errors.ProviderNotFound) as error: MultipassCommand.ensure_multipass(platform) assert error.prompt_installable is prompt_installable
def test_ensure_multipass_on_command_found(self): self.which_mock.return_value = ["multipass"] MultipassCommand.ensure_multipass(platform="linux")