diff tests/test_util.py @ 911:772280aed751

Honor SVN auto-props (solves issue #186) The auto-props are read from the users subversion configuration file (~/.subversion/config on posix). System-wide configuration files are not taken into account. The implementation completely bypasses the subversion bindings, because the current bindings provide little support for this functionality.
author Ronny Voelker <ronny.voelker@googlemail.com>
date Sun, 01 Jan 2012 15:59:15 +0100
parents 312f36a425f0
children 6918f60d0e28
line wrap: on
line diff
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -38,6 +38,7 @@ except AttributeError:
             SkipTest = None
 
 from hgsubversion import util
+from hgsubversion import svnwrap
 
 # Documentation for Subprocess.Popen() says:
 #   "Note that on Windows, you cannot set close_fds to true and
@@ -260,6 +261,10 @@ class TestBase(unittest.TestCase):
         self.wc_path = '%s/testrepo_wc' % self.tmpdir
         self.svn_wc = None
 
+        self.config_dir = self.tmpdir
+        svnwrap.common._svn_config_dir = self.config_dir
+        self.setup_svn_config('')
+
         # Previously, we had a MockUI class that wrapped ui, and giving access
         # to the stream. The ui.pushbuffer() and ui.popbuffer() can be used
         # instead. Using the regular UI class, with all stderr redirected to
@@ -268,6 +273,10 @@ class TestBase(unittest.TestCase):
         self.patch = (ui.ui.write_err, ui.ui.write)
         setattr(ui.ui, self.patch[0].func_name, self.patch[1])
 
+    def setup_svn_config(self, config):
+        with open(self.config_dir + '/config', 'w') as c:
+            c.write(config)
+
     def _makerepopath(self):
         self.repocount += 1
         return '%s/testrepo-%d' % (self.tmpdir, self.repocount)