You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by e....@gmx.net on 2003/08/31 19:05:26 UTC

[PATCH] Increased run_and_verify_svn pickiness on input parameters

Hi.

While rewriting one of the tests, I accidentally passed a tuple (instead of
a list) to run_and_verify_svn. Instead of failing the test,
run_and_verify_svn didn't check the output and just passed the test. I believe it should have
been pickier and wrote the following patch.

bye,

Erik.

Log:
[[[
Increased pickiness of run_and_verify_svn about the types of its
input parameters.

 * subversion/tests/clients/cmdline/svntest/actions.py 
   run_and_verify_svn: extra checks on input value types

]]]


Index: subversion/tests/clients/cmdline/svntest/actions.py
===================================================================
--- subversion/tests/clients/cmdline/svntest/actions.py     (revision 6924)
+++ subversion/tests/clients/cmdline/svntest/actions.py     (working copy)
@@ -46,6 +46,12 @@
   STDERR when output was expected."""
   pass

+class SVNIncorrectDatatype(SVNUnexpectedOutput):
+  """Exception raised if invalid input is passed to the
+  run_and_verify_* API"""
+  pass
+
+
 ######################################################################
 # Used by every test, so that they can run independently of
 # one another.  The first time it's run, it executes 'svnadmin' to
@@ -138,17 +144,21 @@

   if type(expected_stdout) is type([]):
     compare_and_display_lines(message, 'STDOUT', expected_stdout, out)
-  if expected_stdout == SVNAnyOutput:
+  elif expected_stdout == SVNAnyOutput:
     if len(out) == 0:
       if message is not None: print message
       raise SVNExpectedStdout
-
+  elif expected_stdout is not None:
+    raise SVNIncorrectDatatype("Unexpected specification for stdout data")
+
   if type(expected_stderr) is type([]):
     compare_and_display_lines(message, 'STDERR', expected_stderr, err)
-  if expected_stderr == SVNAnyOutput:
+  elif expected_stderr == SVNAnyOutput:
     if len(err) == 0:
       if message is not None: print message
       raise SVNExpectedStderr
+  elif expected_stderr is not None:
+    raise SVNIncorrectDatatype("Unexpected specification for stderr data")
   return out, err



-- 
COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
--------------------------------------------------
1. GMX TopMail - Platz 1 und Testsieger!
2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8. e-Post


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org