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

[PATCH] Add more tests to the svn python bindings

From: Madan U Sreenivasan <madan_at_collab.net>
Date: 2006-06-23 15:34:35 CEST

Hi,

    Pl. find attached some more tests for the svn.wc python bindings.

    btw, I almost completed implementing XFail() for the bindings, when I
realized that assertRaises()/failUnlessRaises() do the same thing. Why do
we need XFail for the python bindings tests?

[[[
Add tests for the svn.wc python binding.

* subversion/bindings/swig/python/tests/wc.py
   (setUp): Modify to open all sub-directories.
   (test_prop_set_get): Test for prop_set2() and prog_get().
   (has_check_binary_prop): Test for has_binary_prop().
]]]

Regards,
Madan.

Index: subversion/bindings/swig/python/tests/wc.py
===================================================================
--- subversion/bindings/swig/python/tests/wc.py (revision 20225)
+++ subversion/bindings/swig/python/tests/wc.py (working copy)
@@ -31,7 +31,7 @@
     client.checkout2(self.repos_url, self.path, rev, rev, True, True,
             client_ctx)
 
- self.wc = wc.adm_open3(None, self.path, True, 0, None)
+ self.wc = wc.adm_open3(None, self.path, True, -1, None)
 
   def test_entry(self):
       wc_entry = wc.entry(self.path, self.wc, True)
@@ -106,6 +106,34 @@
         wc.get_pristine_copy_path(os.path.join(self.path, 'foo')),
         os.path.join(self.path, wc.get_adm_dir(), 'text-base', 'foo.svn-base'))
 
+ def test_prop_set_get(self):
+ path = os.path.join(self.path, "trunk", "README.txt")
+
+ prop = "myprop"
+ propval = "mypropvalue"
+ wc.prop_set2(prop, propval, path, self.wc, True)
+ self.failUnless(wc.prop_get(prop, path, self.wc) == propval)
+
+ # test setting wc and entry properties
+ prop = "svn:wc:foo"
+ propval = "wcmypropvalue"
+ wc.prop_set2(prop, propval, path, self.wc, True)
+ self.failUnless(wc.prop_get(prop, path, self.wc) == propval)
+
+ prop = "svn:entry:foo"
+ propval = "entrypropvalue"
+ self.failUnlessRaises(SubversionException, wc.prop_set2,
+ prop, propval, path, self.wc, True)
+
+ def test_has_binary_prop(self):
+ path = os.path.join(self.path, "trunk", "README.txt")
+
+ self.failIf(wc.has_binary_prop(path, self.wc))
+
+ # Set mime-type to a binary type and test
+ wc.prop_set2("svn:mime-type", "image/gif", path, self.wc, True)
+ self.failUnless(wc.has_binary_prop(path, self.wc))
+
   def tearDown(self):
       wc.adm_close(self.wc)
       shutil.rmtree(self.path)

Add tests for the svn.wc python binding.

* subversion/bindings/swig/python/tests/wc.py
  (setUp): Modify to open all sub-directories.
  (test_prop_set_get): Test for prop_set2() and prog_get().
  (has_check_binary_prop): Test for has_binary_prop().

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jun 23 15:04:31 2006

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.