~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_smart_transport.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-09-29 15:31:52 UTC
  • mfrom: (2052.1.1 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060929153152-9a32a9b020e0f74b
Lukáš Lalinský: Windows-speficic smart server transport selftest fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
        bzrdir,
27
27
        errors,
28
28
        tests,
 
29
        urlutils,
29
30
        )
30
31
from bzrlib.transport import (
31
32
        get_transport,
72
73
        """Feed a canned query version to a server"""
73
74
        to_server = StringIO('hello\n')
74
75
        from_server = StringIO()
75
 
        server = smart.SmartStreamServer(to_server, from_server, local.LocalTransport('file:///'))
 
76
        server = smart.SmartStreamServer(to_server, from_server, 
 
77
            local.LocalTransport(urlutils.local_path_to_url('/')))
76
78
        server._serve_one_request()
77
79
        self.assertEqual('ok\0011\n',
78
80
                         from_server.getvalue())
115
117
        without ssh intermediating.
116
118
        """
117
119
        args = [sys.executable, sys.argv[0], 'serve', '--inet']
 
120
        do_close_fds = True
 
121
        if sys.platform == 'win32':
 
122
            do_close_fds = False
118
123
        child = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
119
 
                                 close_fds=True)
 
124
                                 close_fds=do_close_fds, universal_newlines=True)
120
125
        conn = smart.SmartStreamClient(lambda: (child.stdout, child.stdin))
121
126
        conn.query_version()
122
127
        conn.query_version()