~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/stub_sftp.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-02-24 10:17:14 UTC
  • mfrom: (5055.2.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20100224101714-wy0vr6ldlrq7fdk7
(vila) Fix some sftp test server related failures

Show diffs side-by-side

added added

removed removed

Lines of Context:
297
297
                threading.Thread(target=self._callback, args=(s,)).start()
298
298
            except socket.error, x:
299
299
                sys.excepthook(*sys.exc_info())
300
 
                warning('Socket error during accept() within unit test server'
301
 
                        ' thread: %r' % x)
 
300
                trace.warning('Socket error during accept() '
 
301
                              'within unit test server thread: %r' % x)
302
302
            except Exception, x:
303
303
                # probably a failed test; unit test thread will log the
304
304
                # failure/error
305
305
                sys.excepthook(*sys.exc_info())
306
 
                warning('Exception from within unit test server thread: %r' %
307
 
                        x)
 
306
                trace.warning(
 
307
                    'Exception from within unit test server thread: %r' % x)
308
308
 
309
309
 
310
310
class SocketDelay(object):
438
438
        if not (backing_server is None or
439
439
                isinstance(backing_server, test_server.LocalURLServer)):
440
440
            raise AssertionError(
441
 
                "backing_server should not be %r, because this can only serve the "
442
 
                "local current working directory." % (backing_server,))
 
441
                'backing_server should not be %r, because this can only serve '
 
442
                'the local current working directory.' % (backing_server,))
443
443
        self._original_vendor = ssh._ssh_vendor_manager._cached_ssh_vendor
444
444
        ssh._ssh_vendor_manager._cached_ssh_vendor = self._vendor
 
445
        # FIXME: the following block should certainly just be self._homedir =
 
446
        # osutils.getcwd() but that fails badly on Unix -- vila 20100224
445
447
        if sys.platform == 'win32':
446
448
            # Win32 needs to use the UNICODE api
447
 
            self._homedir = getcwd()
 
449
            self._homedir = os.getcwdu()
448
450
        else:
449
451
            # But Linux SFTP servers should just deal in bytestreams
450
452
            self._homedir = os.getcwd()