def test_uninstall_python(self): ''' Test if it uninstall a python implementation. ''' mock_opt = MagicMock(return_value='salt stack') mock_cmd = MagicMock(return_value=True) mock_all = MagicMock(return_value={'retcode': True, 'stdout': 'salt', 'stderr': 'error'}) with patch.dict(pyenv.__salt__, {'cmd.has_exec': mock_cmd, 'config.option': mock_opt, 'cmd.run_all': mock_all}): self.assertTrue(pyenv.uninstall_python('2.0.0-p0'))
def test_uninstall_python(self): """ Test if it uninstall a python implementation. """ mock_opt = MagicMock(return_value="salt stack") mock_cmd = MagicMock(return_value=True) mock_all = MagicMock( return_value={"retcode": True, "stdout": "salt", "stderr": "error"} ) with patch.dict( pyenv.__salt__, { "cmd.has_exec": mock_cmd, "config.option": mock_opt, "cmd.run_all": mock_all, }, ): self.assertTrue(pyenv.uninstall_python("2.0.0-p0"))