def METHOD_NAME(self):
    """This method builds the content of the test script which will return a list
    of shell commands that will be written to file.
    A typical test will contain: shebang line, job directives, environment variables and variable declaration,
    and content of ``run`` property. For ``shell: python`` we write a python script and
    return immediately. The variables, environment section are not applicable
    for python scripts
    Returns:
        List of shell commands that will be written to file
    """
    # start of each test should have the shebang
    lines = [self.shebang]
    # if shell is python the generated testscript will be run via bash, we invoke
    # python script in bash script.
    if self.shell.name == "python":
        lines = ["#!/bin/bash"]
    sched_lines = self.get_job_directives()
    if sched_lines:
        lines += sched_lines
    if self.burstbuffer:
        burst_buffer_lines = self._get_burst_buffer(self.burstbuffer)
        if burst_buffer_lines:
            lines += burst_buffer_lines
    if self.datawarp:
        data_warp_lines = self._get_data_warp(self.datawarp)
        if data_warp_lines:
            lines += data_warp_lines
    # for python scripts we generate python script and return lines
    if self.shell.name == "python":
        self.logger.debug(f"[{self.name}]: Detected python shell")
        self.write_python_script()
        py_script = "%s.py" % format(os.path.join(self.stage_dir, self.name))
        python_wrapper = self.buildexecutor.executors[self.executor]._settings[
            "shell"
        ]
        python_wrapper_buildspec = shlex.split(self.recipe.get("shell"))[0]
        # if 'shell' property in buildspec specifies 'shell: python' or 'shell: python3' then we use this instead
        if python_wrapper_buildspec.endswith(
            "python"
        ) or python_wrapper_buildspec.endswith("python3"):
            python_wrapper = python_wrapper_buildspec
        lines.append(f"{python_wrapper} {py_script}")
        return lines
    # section below is for shell-scripts (bash, sh, csh, zsh, tcsh, zsh)
    if self.compiler:
        compiler_variables = {
            "BUILDTEST_CC": self.cc,
            "BUILDTEST_CXX": self.cxx,
            "BUILDTEST_FC": self.fc,
            "BUILDTEST_CFLAGS": self.cflags,
            "BUILDTEST_CXXFLAGS": self.cxxflags,
            "BUILDTEST_FFLAGS": self.fflags,
            "BUILDTEST_CPPFLAGS": self.cppflags,
            "BUILDTEST_LDFLAGS": self.ldflags,
        }
        lines += self._get_variables(compiler_variables)
        if self.compiler_settings["env"]:
            lines += self._get_environment(self.compiler_settings["env"])
        if self.compiler_settings["vars"]:
            lines += self._get_variables(self.compiler_settings["vars"])
    # Add environment variables
    env_section = deep_get(
        self.recipe, "executors", self.executor, "env"
    ) or self.recipe.get("env")
    var_section = deep_get(
        self.recipe, "executors", self.executor, "vars"
    ) or self.recipe.get("vars")
    env_lines = self._get_environment(env_section)
    if env_lines:
        lines += env_lines
    var_lines = self._get_variables(var_section)
    if var_lines:
        lines += var_lines
    if self.compiler_settings["modules"]:
        lines += self.compiler_settings["modules"]
    lines.append("# Content of run section")
    # Add run section
    lines += [self.recipe["run"]]
    return lines