def test_list(self): ''' Test if it list the installable versions of python. ''' 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.assertListEqual(pyenv.list_(), [])
def test_list(self): """ Test if it list the installable versions of python. """ 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.assertListEqual(pyenv.list_(), [])