~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_serve.py

  • Committer: Alexander Belchenko
  • Date: 2007-03-05 14:30:00 UTC
  • mto: This revision was merged to the branch mainline in revision 2317.
  • Revision ID: bialix@ukr.net-20070305143000-g5fw5i2k7ot6am2n
test_bzr_connect_to_bzr_ssh: win32-compatibility

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import os
21
21
import signal
22
22
import subprocess
 
23
import sys
23
24
import threading
24
25
 
25
 
from bzrlib import errors
 
26
from bzrlib import (
 
27
    errors,
 
28
    osutils,
 
29
    )
26
30
from bzrlib.branch import Branch
27
31
from bzrlib.bzrdir import BzrDir
28
32
from bzrlib.errors import ParamikoNotPresent
187
191
 
188
192
        # Access the branch via a bzr+ssh URL.  The BZR_REMOTE_PATH environment
189
193
        # variable is used to tell bzr what command to run on the remote end.
190
 
        path_to_branch = os.path.abspath('a_branch')
 
194
        path_to_branch = osutils.abspath('a_branch')
191
195
        
192
196
        orig_bzr_remote_path = os.environ.get('BZR_REMOTE_PATH')
193
 
        os.environ['BZR_REMOTE_PATH'] = self.get_bzr_path()
 
197
        bzr_remote_path = self.get_bzr_path()
 
198
        if sys.platform == 'win32':
 
199
            bzr_remote_path = sys.executable + ' ' + self.get_bzr_path()
 
200
        os.environ['BZR_REMOTE_PATH'] = bzr_remote_path
194
201
        try:
 
202
            if sys.platform == 'win32':
 
203
                path_to_branch = os.path.splitdrive(path_to_branch)[1]
195
204
            branch = Branch.open(
196
205
                'bzr+ssh://fred:secret@localhost:%d%s' % (port, path_to_branch))
197
206
            
209
218
 
210
219
        self.assertEqual(
211
220
            ['%s serve --inet --directory=/ --allow-writes'
212
 
             % self.get_bzr_path()],
 
221
             % bzr_remote_path],
213
222
            self.command_executed)
214
223