Hi Daniel,
Thanks for the review. Here's another revision.
[[[
* subversion/tests/cmdline/svntest/actions.py
(run_and_verify_svnrdump): Add new function to run svnrdump with
'-q', verify that stderr is empty, exit_code is zero, and return the
output on stdout.
* subversion/tests/cmdline/svnrdump_tests.py
(run_test, basic_svnrdump): Factor out run_svnrdump in favor of
run_and_verify_svnrdump.
Suggested by: danielsh
Review by: danielsh
]]]
Index: subversion/tests/cmdline/svntest/actions.py
===================================================================
--- subversion/tests/cmdline/svntest/actions.py (revision 978817)
+++ subversion/tests/cmdline/svntest/actions.py (working copy)
@@ -284,6 +284,18 @@ def run_and_verify_dump(repo_dir):
return output
+def run_and_verify_svnrdump(repo_dir):
+ "Runs 'svnadmin dump' and reports any errors, returning the dump content."
+ exit_code, output, errput = main.run_svnrdump('-q', repo_dir)
+
+ if exit_code != 0:
+ raise svntest.Failure("Exit code not 0")
+
+ verify.verify_outputs("Missing expected output(s)", output, errput,
+ verify.AnyOutput, [])
+ return output
+
+
def load_repo(sbox, dumpfile_path = None, dump_str = None):
"Loads the dumpfile into sbox"
if not dump_str:
Index: subversion/tests/cmdline/svnrdump_tests.py
===================================================================
--- subversion/tests/cmdline/svnrdump_tests.py (revision 978852)
+++ subversion/tests/cmdline/svnrdump_tests.py (working copy)
@@ -73,16 +73,8 @@ def run_test(sbox, dumpfile_name):
svntest.actions.run_and_verify_load(sbox.repo_dir, svnadmin_dumpfile)
# Create a dump file using svnrdump
- r, svnrdump_dumpfile, err = svntest.main.run_svnrdump('-q', sbox.repo_url)
+ svnrdump_dumpfile = svntest.actions.run_and_verify_svnrdump(sbox.repo_url)
- # Check error code
- if (r != 0):
- raise svntest.Failure('Result code not 0')
-
- # Check the output from stderr
- if err:
- raise SVNUnexpectedStderr(err)
-
# Compare the output from stdout
svntest.verify.compare_and_display_lines(
"Dump files", "DUMP", svnadmin_dumpfile, svnrdump_dumpfile)
@@ -94,11 +86,8 @@ def basic_svnrdump(sbox):
"dump the standard sbox repos"
sbox.build(read_only = True, create_wc = False)
- r, out, err = svntest.main.run_svnrdump(sbox.repo_url)
+ out = svntest.actions.run_and_verify_svnrdump(sbox.repo_url)
- if (r != 0):
- raise svntest.Failure('Result code not 0')
-
if not out[0].startswith('SVN-fs-dump-format-version:'):
raise svntest.Failure('No valid output')
Received on 2010-07-24 19:19:16 CEST