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

Re: svn commit: r14898 - in trunk/subversion: tests/clients/cmdline

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2005-06-02 00:06:53 CEST

lundblad@tigris.org writes:

> Author: lundblad
> Date: Tue May 31 16:40:03 2005
> New Revision: 14898

I'm in favour of regression tests, but this one could be better.

> +def lock_uri_encoded(sbox):
> + "lock and unlock a file with an URI-unsafe name"
> +
> + sbox.build()
> + wc_dir = sbox.wc_dir
> +
> + # lock a file as wc_author
> + fname = 'amazing space'
> + file_path = os.path.join(sbox.wc_dir, fname)
> +
> + svntest.main.file_append(file_path, "This represents a binary file\n")
> + svntest.main.run_svn(None, "add", file_path)
> + svntest.main.run_svn(None, 'commit',
> + '--username', svntest.main.wc_author,
> + '--password', svntest.main.wc_passwd,
> + '-m', '', file_path)

run_svn does almost no error checking, run_and_verify_commit would be
much better. I suppose you could claim that the subsequent lock will
ensure that the commit worked, except...

> + svntest.actions.run_and_verify_svn(None, None, None, 'lock',
> + '--username', svntest.main.wc_author,
> + '--password', svntest.main.wc_passwd,
> + '-m', '', file_path)

...there is almost no error checking here either. run_and_verify_svn
is a bit better than run_svn but it still doesn't really verify that a
lock got created. Using 'svn info' or run_and_verify_status would be
an improvement.

> +
> +
> + svntest.actions.run_and_verify_svn(None, None, None, 'unlock',
> + '--username', svntest.main.wc_author,
> + '--password', svntest.main.wc_passwd,
> + file_path)

This doesn't verify that the lock got released.

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Jun 2 00:40:34 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.