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

Re: [PATCH] regression test for issue #876

From: Branko Čibej <brane_at_xbc.nu>
Date: 2005-05-11 14:40:24 CEST

vivek@collab.net wrote:

>[[[
> Add a regression test for issue #876
>* subversion/tests/clients/cmdline/revert_tests.py
> (revert_moved_file): A new function to test a moved and
> then reverted file.
>]]]
>
>
O.K., this is almost right, except for one (fairly fundamental) thing:

>+ # at this point, svn status on iota_path_moved should return nothing
>+ # since it should disappear on reverting the move, and since svn status
>+ # on a non-existent file returns nothing.
>+ exp_output = ''
>+ output, err = \
>+ svntest.actions.run_and_verify_svn (None, None, None, \
>+ 'status', '-v', iota_path_moved)
>+ if (exp_output != str (output)):
>+ ####TODO: uncomment when test is no longer XFail
>+ ####print "Expected output:", exp_output, ": not found in:", output
>+ raise svntest.Failure
>
>
Once more: an XFAIL test should not need *any* changes when it's no
longer XFAIL. It makes absolutely no sense to hide the failure mode of
an XFAIL test. It's also *dangerous* to leave unfinished TODO's around
like that, because someone must actually remember to look for them when
the bug's fixed.

Now, since run_and_verify_svn, when given correct inputs, will raise an
error if the output of the "svn" command isn't correct, you can replace
all of the above with:

    svntest.actions.run_and_verify_svn(None, [], [],
                                       'status', '-v', iota_path_moved)

The run_and_verify_* functions also print the different output.

Oh, two minor stylistic nits: In Python, we don't put spaces between
function names and argument lists (see the rest of the file). And you
don't need \ for line continuation within an argument list (or any other
kind of list, for that matter).

>+
>+
> ########################################################################
> # Run the tests
>
>@@ -222,6 +258,7 @@
> XFail(revert_reexpand_keyword),
> Skip(revert_corrupted_text_base, 1),
> revert_replaced_file_without_props,
>+ XFail(revert_moved_file),
> ]
>
> if __name__ == '__main__':
>
-- Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed May 11 15:03:20 2005

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.