Пример #1
0
 def script_shell_command(cls, script_name):
     script_path = cls.script_path(script_name)
     # Win32 does not support shebang. We need to detect the interpreter ourself.
     if sys.platform == 'win32':
         interpreter = Executive.interpreter_for_script(script_path)
         if interpreter:
             return [interpreter, script_path]
     return [script_path]
Пример #2
0
 def script_shell_command(cls, script_name):
     script_path = cls.script_path(script_name)
     # Win32 does not support shebang. We need to detect the interpreter ourself.
     if sys.platform == 'win32':
         interpreter = Executive.interpreter_for_script(script_path)
         if interpreter:
             return [interpreter, script_path]
     return [script_path]
Пример #3
0
    def assert_interpreter_for_content(self, intepreter, content):
        fs = MockFileSystem()

        tempfile, temp_name = fs.open_binary_tempfile('')
        tempfile.write(content)
        tempfile.close()
        file_interpreter = Executive.interpreter_for_script(temp_name, fs)

        self.assertEqual(file_interpreter, intepreter)
Пример #4
0
    def assert_interpreter_for_content(self, intepreter, content):
        fs = MockFileSystem()

        tempfile, temp_name = fs.open_binary_tempfile('')
        tempfile.write(content)
        tempfile.close()
        file_interpreter = Executive.interpreter_for_script(temp_name, fs)

        self.assertEqual(file_interpreter, intepreter)