PATCH : fix some win32 testing issues

Bug #188233 reported by Adrian Wilkins
2
Affects Status Importance Assigned to Milestone
Bazaar Subversion Plugin
Fix Released
Medium
Jelmer Vernooij

Bug Description

=== modified file 'tests/__init__.py'
--- tests/__init__.py 2008-01-31 23:04:12 +0000
+++ tests/__init__.py 2008-02-01 23:49:35 +0000
@@ -17,6 +17,7 @@
 """Tests for the bzr-svn plugin."""

 import os
+import sys
 import bzrlib
 from bzrlib import osutils
 from bzrlib.bzrdir import BzrDir
@@ -46,12 +47,11 @@
         :return: Handle to the repository.
         """
         abspath = os.path.join(self.test_dir, relpath)
- repos_url = "file://%s" % abspath
-
+
         svn.repos.create(abspath, '', '', None, None)
-
+
         if allow_revprop_changes:
- if os.name == 'win32':
+ if sys.platform == 'win32':
                 revprop_hook = os.path.join(abspath, "hooks", "pre-revprop-change.bat")
                 open(revprop_hook, 'w').write("exit 0\n")
             else:
@@ -59,6 +59,10 @@
                 open(revprop_hook, 'w').write("#!/bin/sh\n")
                 os.chmod(revprop_hook, os.stat(revprop_hook).st_mode | 0111)

+ if sys.platform == 'win32':
+ abspath = '/' + abspath # The root of the filesystem on win32 is one level above the "drives"
+ repos_url = "file://%s" % abspath
+
         return repos_url

     def make_remote_bzrdir(self, relpath):

=== modified file 'tests/test_convert.py'
--- tests/test_convert.py 2008-01-28 21:50:03 +0000
+++ tests/test_convert.py 2008-02-01 23:43:43 +0000
@@ -345,6 +345,9 @@
         repos = self.load_dumpfile(filename, 'g')
         convert_repository(repos, os.path.join(self.test_dir, "e"),
                            TrunkBranchingScheme())
+ abspath = self.test_dir
+ if sys.platform == 'win32':
+ abspath = '/' + abspath
         branch = Branch.open(os.path.join(self.test_dir, "e", "trunk"))
         self.assertEqual("file://%s/e/trunk" % self.test_dir, branch.base.rstrip("/"))
         self.assertEqual(default_mapping.generate_revision_id("6987ef2d-cd6b-461f-9991-6f1abef3bd59", 1, 'trunk', "trunk0"), branch.last_revision())

=== modified file 'tests/test_push.py'
--- tests/test_push.py 2008-01-28 22:52:09 +0000
+++ tests/test_push.py 2008-02-01 23:44:07 +0000
@@ -148,7 +148,7 @@
                         self.svndir.open_branch().last_revision())

     def test_symlink(self):
- if os.name == 'win32':
+ if sys.platform == 'win32':
             return
         os.symlink("bla", "dc/south")
         assert os.path.islink("dc/south")

=== modified file 'tests/test_repos.py'
--- tests/test_repos.py 2008-01-29 22:26:01 +0000
+++ tests/test_repos.py 2008-02-01 23:44:35 +0000
@@ -152,6 +152,9 @@

         repos = Repository.open(repos_url)

+ abspath = self.test_dir
+ if sys.platform == 'win32':
+ abspath = '/' + abspath
         self.assertEqual("SvnRepository('file://%s/')" % urlutils.join(self.test_dir, "a"), repos.__repr__())

     def test_get_branch_invalid_revision(self):

Related branches

Revision history for this message
Adrian Wilkins (adrian-wilkins) wrote :
Revision history for this message
Adrian Wilkins (adrian-wilkins) wrote :
Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 188233] Re: PATCH : fix some win32 testing issues

Merged, thanks!

  status fixcommitted
--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

Jelmer Vernooij (jelmer)
Changed in bzr-svn:
status: New → Fix Committed
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
assignee: nobody → jelmer
importance: Undecided → Medium
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
milestone: none → 0.4.8
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.