From ff9cd1eefbb72964800199ac290ad9f15937b140 Mon Sep 17 00:00:00 2001 From: Julian Foad Date: Tue, 26 Jan 2010 12:34:12 +0000 Subject: [PATCH] Expand some doc strings in the test framework. * subversion/tests/cmdline/svntest/actions.py (run_and_verify_svn2): Document that line terminators are included in the returned stdout and stderr. * subversion/tests/cmdline/svntest/main.py (run_command, wait_on_pipe, spawn_process, run_command_stdin, run_svn, run_svnadmin, run_svnlook, run_svnsync, run_svnversion): Document that line terminators are included in the returned stdout and stderr. git-svn-id: http://svn.apache.org/repos/asf/subversion/trunk/subversion/tests/cmdline@903198 13f79535-47bb-0310-9956-ffa450edef68 --- svntest/actions.py | 7 ++++--- svntest/main.py | 27 +++++++++++++++------------ 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/svntest/actions.py b/svntest/actions.py index e41238f..4c64030 100644 --- a/svntest/actions.py +++ b/svntest/actions.py @@ -220,9 +220,10 @@ def run_and_verify_svn(message, expected_stdout, expected_stderr, *varargs): def run_and_verify_svn2(message, expected_stdout, expected_stderr, expected_exit, *varargs): - """Invokes main.run_svn() with *VARARGS, returns exit code as int, stdout - and stderr as lists of lines. For both EXPECTED_STDOUT and EXPECTED_STDERR, - create an appropriate instance of verify.ExpectedOutput (if necessary): + """Invoke main.run_svn() with *VARARGS. Return exit code as int; stdout, + stderr as lists of lines (including line terminators). For both + EXPECTED_STDOUT and EXPECTED_STDERR, create an appropriate instance of + verify.ExpectedOutput (if necessary): - If it is an array of strings, create a vanilla ExpectedOutput. diff --git a/svntest/main.py b/svntest/main.py index e774153..a9e1d14 100644 --- a/svntest/main.py +++ b/svntest/main.py @@ -358,9 +358,9 @@ def get_fsfs_format_file_path(repo_dir): # Run any binary, logging the command line and return code def run_command(command, error_expected, binary_mode=0, *varargs): - """Run COMMAND with VARARGS; return exit code as int; stdout, stderr - as lists of lines. See run_command_stdin() for details. - If ERROR_EXPECTED is None, any stderr also will be printed.""" + """Run COMMAND with VARARGS. Return exit code as int; stdout, stderr + as lists of lines (including line terminators). See run_command_stdin() + for details. If ERROR_EXPECTED is None, any stderr also will be printed.""" return run_command_stdin(command, error_expected, binary_mode, None, *varargs) @@ -433,8 +433,8 @@ def wait_on_pipe(waiter, binary_mode, stdin=None): to finish, dying if it does. If KID fails, create an error message containing any stdout and stderr from the kid. Show COMMAND_STRING in diagnostic messages. Normalize Windows line endings of stdout and stderr - if not BINARY_MODE. Return KID's exit code, stdout and stderr (the latter - two as lists).""" + if not BINARY_MODE. Return KID's exit code as int; stdout, stderr as + lists of lines (including line terminators).""" if waiter is None: return @@ -477,7 +477,9 @@ def wait_on_pipe(waiter, binary_mode, stdin=None): def spawn_process(command, binary_mode=0, stdin_lines=None, *varargs): """Run any binary, supplying input text, logging the command line. - Normalize Windows line endings of stdout and stderr if not BINARY_MODE.""" + Normalize Windows line endings of stdout and stderr if not BINARY_MODE. + Return exit code as int; stdout, stderr as lists of lines (including + line terminators).""" if stdin_lines and not isinstance(stdin_lines, list): raise TypeError("stdin_lines should have list type") @@ -509,7 +511,8 @@ def run_command_stdin(command, error_expected, binary_mode=0, is willing to buffer, this will deadlock, with both Python and COMMAND waiting to write to each other for ever. Normalize Windows line endings of stdout and stderr if not BINARY_MODE. - Return exit code as int; stdout, stderr as lists of lines. + Return exit code as int; stdout, stderr as lists of lines (including + line terminators). If ERROR_EXPECTED is None, any stderr also will be printed.""" if verbose_mode: @@ -594,7 +597,7 @@ def _with_auth(args): # For running subversion and returning the output def run_svn(error_expected, *varargs): """Run svn with VARARGS; return exit code as int; stdout, stderr as - lists of lines. + lists of lines (including line terminators). If ERROR_EXPECTED is None, any stderr also will be printed. If you're just checking that something does/doesn't come out of stdout/stderr, you might want to use actions.run_and_verify_svn().""" @@ -604,23 +607,23 @@ def run_svn(error_expected, *varargs): # For running svnadmin. Ignores the output. def run_svnadmin(*varargs): """Run svnadmin with VARARGS, returns exit code as int; stdout, stderr as - list of lines.""" + list of lines (including line terminators).""" return run_command(svnadmin_binary, 1, 0, *varargs) # For running svnlook. Ignores the output. def run_svnlook(*varargs): """Run svnlook with VARARGS, returns exit code as int; stdout, stderr as - list of lines.""" + list of lines (including line terminators).""" return run_command(svnlook_binary, 1, 0, *varargs) def run_svnsync(*varargs): """Run svnsync with VARARGS, returns exit code as int; stdout, stderr as - list of lines.""" + list of lines (including line terminators).""" return run_command(svnsync_binary, 1, 0, *(_with_config_dir(varargs))) def run_svnversion(*varargs): """Run svnversion with VARARGS, returns exit code as int; stdout, stderr - as list of lines.""" + as list of lines (including line terminators).""" return run_command(svnversion_binary, 1, 0, *varargs) def run_entriesdump(path): -- 2.11.4.GIT