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

[PATCH] Cleanup wc in the svn.wc python binding test script

From: Madan U Sreenivasan <madan_at_collab.net>
Date: 2006-06-16 09:20:41 CEST

Hi,

    The subversion/bindings/swig/python/tests/wc.py script fails, when run
more than once.
    This is because the working copy path used is not cleaned-up after use.
Pl. find attached a patch to fix this.

[[[
Cleanup wc in the svn.wc python binding test script.

* subversion/bindings/swig/python/tests/wc.py
   (global): import shutil.
   (setUp): Remove wc path, if already exists.
   (tearDown): Cleanup wc path after the tests.
]]]

Regards,
Madan.

Index: subversion/bindings/swig/python/tests/wc.py
===================================================================
--- subversion/bindings/swig/python/tests/wc.py (revision 20142)
+++ subversion/bindings/swig/python/tests/wc.py (working copy)
@@ -1,4 +1,5 @@
 import unittest, os, tempfile
+import shutil
 
 from svn import core, repos, wc, client
 from libsvn.core import SubversionException
@@ -22,6 +23,11 @@
 
     self.path = os.path.join(tempfile.gettempdir(), 'wc')
 
+ # remove wc dir, if exists
+ # Do we need to handle permissions for NT?
+ if os.path.exists(self.path):
+ shutil.rmtree(self.path)
+
     client_ctx = client.create_context()
     
     rev = core.svn_opt_revision_t()
@@ -107,6 +113,7 @@
 
   def tearDown(self):
       wc.adm_close(self.wc)
+ shutil.rmtree(self.path)
 
 def suite():
     return unittest.makeSuite(SubversionRepositoryTestCase, 'test',

Cleanup wc in the svn.wc python binding test script.

* subversion/bindings/swig/python/tests/wc.py
  (global): import shutil.
  (setUp): Remove wc path, if already exists.
  (tearDown): Cleanup wc path after the tests.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jun 16 08:50:17 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.