b.t.script : module documentation

Part of bzrlib.tests

Shell-like test scripts.

See developers/testing.html for more explanations.

Function split Split a command line respecting quotes.
Class ScriptRunner Run a shell-like script from a test.
Class TestCaseWithMemoryTransportAndScript Helper class to experiment shell-like test and memory fs.
Class TestCaseWithTransportAndScript Helper class to quickly define shell-like tests.
Function run_script Run the given script within a testcase
Function _script_to_commands Turn a script into a list of commands with their associated IOs.
Function _scan_redirection_options Recognize and process input and output redirections.
def split(s):
Split a command line respecting quotes.
def _script_to_commands(text, file_name=None):
Turn a script into a list of commands with their associated IOs.

    Each command appears on a line by itself starting with '$ '. It can be
    associated with an input that will feed it and an expected output.

    Comments starts with '#' until the end of line.
    Empty lines are ignored.

    Input and output are full lines terminated by a '
'.

    Input lines start with '<'.
    Output lines start with nothing.
    Error lines start with '2>'.

    :return: A sequence of ([args], input, output, errors), where the args are
        split in to words, and the input, output, and errors are just strings,
        typically containing newlines.
    
def _scan_redirection_options(args):
Recognize and process input and output redirections.
ParametersargsThe command line arguments
ReturnsA tuple containing: - The file name redirected from or None - The file name redirected to or None - The mode to open the output file or None - The reamining arguments
def run_script(test_case, script_string, null_output_matches_anything=False):
Run the given script within a testcase
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.