Exemplo n.º 1
0
 def test_requested_not_exists(self):
     side_effect = IOError("[Errno 2] No such file or directory: 'pythonME'")
     with patch.object(helpers, 'logged_exec',
                       side_effect=side_effect), self.assertRaises(SystemExit):
         helpers._get_interpreter_info('pythonME')
     self.assertLoggedError("Error getting requested interpreter version:"
                            " [Errno 2] No such file or directory: 'pythonME'")
Exemplo n.º 2
0
 def test_requested_not_exists(self):
     side_effect = IOError(
         "[Errno 2] No such file or directory: 'pythonME'")
     with patch.object(
             helpers, 'logged_exec',
             side_effect=side_effect), self.assertRaises(SystemExit):
         helpers._get_interpreter_info('pythonME')
     self.assertLoggedError(
         "Error getting requested interpreter version:"
         " [Errno 2] No such file or directory: 'pythonME'")
Exemplo n.º 3
0
    def test_requested_not_exists(self):
        side_effect = IOError("[Errno 2] No such file or directory: 'pythonME'")

        with patch('fades.helpers.logged_exec') as mock_lexec:
            mock_lexec.side_effect = side_effect

            with self.assertRaises(Exception):
                helpers._get_interpreter_info('pythonME')

        self.assertLoggedError("Error getting requested interpreter version:"
                               " [Errno 2] No such file or directory: 'pythonME'")
Exemplo n.º 4
0
    def test_requested_not_exists(self):
        side_effect = IOError("[Errno 2] No such file or directory: 'pythonME'")

        with patch('fades.helpers.logged_exec') as mock_lexec:
            mock_lexec.side_effect = side_effect

            with self.assertRaises(Exception):
                helpers._get_interpreter_info('pythonME')

        self.assertLoggedError("Error getting requested interpreter version:"
                               " [Errno 2] No such file or directory: 'pythonME'")
Exemplo n.º 5
0
 def test_requested_fullpath_nodigit(self):
     response = [(
         '{"serial": 0,"path": "/path/to/python","minor": 8,"major": 9,"micro": 0,'
         '"releaselevel": "ultimate"}')]
     with patch.object(helpers, 'logged_exec', return_value=response):
         interpreter = helpers._get_interpreter_info('/path/to/python')
     self.assertEqual(interpreter, '/path/to/python9.8')
Exemplo n.º 6
0
 def test_none_requested(self):
     with patch.object(sys, 'version_info',
                       (9, 8)), patch.object(sys, 'executable',
                                             '/path/to/python'):
         interpreter = helpers._get_interpreter_info(None)
     self.assertEqual(interpreter, '/path/to/python9.8')
Exemplo n.º 7
0
 def test_requested_fullpath_with_minor(self):
     response = [('{"serial": 0,"path": "/path/to/python9.8","minor": 8,"major": 9,"micro": 0,'
                 '"releaselevel": "ultimate"}')]
     with patch.object(helpers, 'logged_exec', return_value=response):
         interpreter = helpers._get_interpreter_info('/path/to/python9.8')
     self.assertEqual(interpreter, '/path/to/python9.8')
Exemplo n.º 8
0
 def test_none_requested(self):
     with patch.object(sys, 'version_info', (9, 8)), patch.object(sys,
                                                                  'executable',
                                                                  '/path/to/python'):
         interpreter = helpers._get_interpreter_info(None)
     self.assertEqual(interpreter, '/path/to/python9.8')