From 8578bdb640e7d259077f8daaca278a612c2c7343 Mon Sep 17 00:00:00 2001 From: Julian Foad Date: Wed, 7 Sep 2005 11:49:28 +0000 Subject: [PATCH] Correct an accidental lack of checking in the regression tests. The expected stderr was often specified as "None" (meaning ignore it) where "[]" (meaning no output) was intended, so the tests were not as strict as they should be. Prevent this particular case from happening again by disallowing "None" as the "expected_stderr" argument of the two functions involved, since its meaning was too confusing and that facility doesn't appear to be needed. If it is needed in future, it should be handled by something similar to "SVNAnyOutput". * subversion/tests/clients/cmdline/svntest/actions.py (run_and_verify_svnversion, run_and_verify_svn): Raise an exception if "expected_stderr" is "None". * subversion/tests/clients/cmdline/basic_tests.py * subversion/tests/clients/cmdline/cat_tests.py * subversion/tests/clients/cmdline/commit_tests.py * subversion/tests/clients/cmdline/copy_tests.py * subversion/tests/clients/cmdline/diff_tests.py * subversion/tests/clients/cmdline/history_tests.py * subversion/tests/clients/cmdline/import_tests.py * subversion/tests/clients/cmdline/lock_tests.py * subversion/tests/clients/cmdline/merge_tests.py * subversion/tests/clients/cmdline/prop_tests.py * subversion/tests/clients/cmdline/revert_tests.py * subversion/tests/clients/cmdline/svnversion_tests.py * subversion/tests/clients/cmdline/trans_tests.py * subversion/tests/clients/cmdline/update_tests.py * subversion/tests/clients/cmdline/utf8_tests.py Pass "[]" instead of "None" for "expected_stderr" in calls to run_and_verify_svnversion() and run_and_verify_svn(). git-svn-id: http://svn.apache.org/repos/asf/subversion/trunk/subversion/tests/clients/cmdline@856154 13f79535-47bb-0310-9956-ffa450edef68 --- svntest/actions.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/svntest/actions.py b/svntest/actions.py index 885f129..41ad39f 100644 --- a/svntest/actions.py +++ b/svntest/actions.py @@ -151,7 +151,7 @@ def run_and_verify_svnversion(message, wc_dir, repo_url, if len(err) == 0: if message is not None: print message raise SVNExpectedStderr - elif expected_stderr is not None: + else: raise SVNIncorrectDatatype("Unexpected specification for stderr data") return out, err @@ -166,10 +166,15 @@ def run_and_verify_svn(message, expected_stdout, expected_stderr, *varargs): - If it is a single string, invoke match_or_fail() on MESSAGE, the expected output, and the actual output. - - If it is None, do nothing with it. + If EXPECTED_STDOUT is None, do not check stdout. + EXPECTED_STDERR may not be None. If a comparison function fails, it will raise an error.""" ### TODO catch and throw particular exceptions from above + + if expected_stderr is None: + raise SVNIncorrectDatatype("expected_stderr must not be None") + want_err = None if expected_stderr is not None and expected_stderr is not []: want_err = 1 -- 2.11.4.GIT