示例#1
0
文件: pyenv_test.py 项目: DaveQB/salt
 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_(), [])
示例#2
0
 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_(), [])
示例#3
0
 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_(), [])