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

Re: [PATCH] Start tests for Python bindings of svn_auth_*

From: Lieven Govaerts <svnlgo_at_mobsol.be>
Date: 2007-12-09 08:26:04 CET

Jelmer Vernooij wrote:
> The attached patch adds some first tests for the svn_auth_* Python
> bindings. Next, I hope to add proper bindings and tests for
> svn_auth_get_parameter() and hopefully also the ability to implement a
> custom auth provider from within Python.
>
> If there are no objections, I'll commit this patch in the next couple of
> days.
>
> [[[
> Start testsuite for the Python bindings of svn_auth_*.
>
> * subversion/bindings/swig/python/tests/run_all.py: Run auth tests.
> * subversion/bindings/swig/python/tests/auth.py: New file.
> ]]]
>
> Cheers,
>
> Jelmer
>
>

Besides testing for exceptions, can you check if the functions did what
you wanted? Examples of what I'm thinking of inline.

> === added file 'subversion/bindings/swig/python/tests/auth.py'
> --- subversion/bindings/swig/python/tests/auth.py 1970-01-01 00:00:00 +0000
> +++ subversion/bindings/swig/python/tests/auth.py 2007-12-09 05:07:12 +0000
> @@ -0,0 +1,20 @@
> +import unittest, os, setup_path
> +
> +from svn import core
> +
> +class SubversionAuthTestCase(unittest.TestCase):
> + """Test cases for the Subversion auth."""
> +
> + def test_open(self):
> + baton = core.svn_auth_open([])
Ex. assert baton

> +
> + def test_set_parameter(self):
> + baton = core.svn_auth_open([])
> + core.svn_auth_set_parameter(baton, "name", "somedata")
Ex. assert core.svn_auth_get_parameter(baton, "name") == "somedata"

> +def suite():
> + return unittest.makeSuite(SubversionAuthTestCase, 'test')
> +
> +if __name__ == '__main__':
> + runner = unittest.TextTestRunner()
> + runner.run(suite())
..

Lieven

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Dec 9 08:26:09 2007

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.