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]
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)