[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Make run_and_verify_svnrdump more extensible

From: Ramkumar Ramachandra <artagnon_at_gmail.com>
Date: Mon, 26 Jul 2010 19:01:45 +0530

[[[
* subversion/tests/cmdline/svntest/actions.py
  (run_and_verify_svnrdump): Make it more extensible by adding extra
  arguments to check expected vales. Design it like
  run_and_verify_svnadmin2.

* subversion/tests/cmdline/svnrdump_tests.py
  (run_test, basic_svnrdump): Track the above change.

Suggested by: rhuijben
]]]

Index: subversion/tests/cmdline/svntest/actions.py
===================================================================
--- subversion/tests/cmdline/svntest/actions.py (revision 979269)
+++ subversion/tests/cmdline/svntest/actions.py (working copy)
@@ -284,18 +284,16 @@ def run_and_verify_dump(repo_dir):
   return output
 
 
-def run_and_verify_svnrdump(*varargs):
- "Runs 'svnadmin dump' and reports any errors, returning the dump content."
- exit_code, output, errput = main.run_svnrdump('-q', *varargs)
+def run_and_verify_svnrdump(expected_stdout, expected_stderr,
+ expected_exit, *varargs):
+ """Runs 'svnrdump' checking output and exit code."""
 
- if exit_code != 0:
- raise svntest.Failure("Exit code not 0")
+ exit_code, output, err = main.run_svnrdump(*varargs)
+ verify.verify_outputs("Unexpected output", output, err,
+ expected_stdout, expected_stderr)
+ verify.verify_exit_code("Unexpected return code", exit_code, expected_exit)
+ return exit_code, output, err
 
- 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 979269)
+++ subversion/tests/cmdline/svnrdump_tests.py (working copy)
@@ -73,7 +73,9 @@ def run_test(sbox, dumpfile_name):
   svntest.actions.run_and_verify_load(sbox.repo_dir, svnadmin_dumpfile)
 
   # Create a dump file using svnrdump
- svnrdump_dumpfile = svntest.actions.run_and_verify_svnrdump('dump', sbox.repo_url)
+ _, svnrdump_dumpfile, _ = \
+ svntest.actions.run_and_verify_svnrdump(svntest.verify.AnyOutput, [], 0,
+ 'dump', '-q', sbox.repo_url)
 
   # Compare the output from stdout
   svntest.verify.compare_and_display_lines(
@@ -86,7 +88,9 @@ def basic_svnrdump(sbox):
   "dump the standard sbox repos"
   sbox.build(read_only = True, create_wc = False)
 
- out = svntest.actions.run_and_verify_svnrdump('dump', sbox.repo_url)
+ _, out, _ = \
+ svntest.actions.run_and_verify_svnrdump(svntest.verify.AnyOutput, [], 0,
+ 'dump', '-q', sbox.repo_url)
 
   if not out[0].startswith('SVN-fs-dump-format-version:'):
     raise svntest.Failure('No valid output')
Received on 2010-07-26 15:34:17 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.