/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/tests/http_server.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
import socket
25
25
import urlparse
26
26
 
27
 
from bzrlib import urlutils
28
 
from bzrlib.tests import test_server
 
27
from .. import (
 
28
    osutils,
 
29
    urlutils,
 
30
)
 
31
from . import test_server
29
32
 
30
33
 
31
34
class BadWebserverPath(ValueError):
80
83
        """
81
84
        try:
82
85
            self._handle_one_request()
83
 
        except socket.error, e:
 
86
        except socket.error as e:
84
87
            # Any socket error should close the connection, but some errors are
85
88
            # due to the client closing early and we don't want to pollute test
86
89
            # results, so we raise only the others.
458
461
        self.logs.append(format % args)
459
462
 
460
463
    def start_server(self, backing_transport_server=None):
461
 
        """See bzrlib.transport.Server.start_server.
 
464
        """See breezy.transport.Server.start_server.
462
465
 
463
466
        :param backing_transport_server: The transport that requests over this
464
467
            protocol should be forwarded to. Note that this is currently not
472
475
            raise AssertionError(
473
476
                "HTTPServer currently assumes local transport, got %s" %
474
477
                backing_transport_server)
475
 
        self._home_dir = os.getcwdu()
 
478
        self._home_dir = osutils.getcwd()
476
479
        self._local_path_parts = self._home_dir.split(os.path.sep)
477
480
        self.logs = []
478
481
 
481
484
            self._url_protocol, self.host, self.port)
482
485
 
483
486
    def get_url(self):
484
 
        """See bzrlib.transport.Server.get_url."""
 
487
        """See breezy.transport.Server.get_url."""
485
488
        return self._get_remote_url(self._home_dir)
486
489
 
487
490
    def get_bogus_url(self):
488
 
        """See bzrlib.transport.Server.get_bogus_url."""
 
491
        """See breezy.transport.Server.get_bogus_url."""
489
492
        # this is chosen to try to prevent trouble with proxies, weird dns,
490
493
        # etc
491
494
        return self._url_protocol + '://127.0.0.1:1/'