~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/http_server.py

  • Committer: Andrew Bennetts
  • Date: 2010-01-15 03:58:20 UTC
  • mfrom: (4963 +trunk)
  • mto: (4973.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4975.
  • Revision ID: andrew.bennetts@canonical.com-20100115035820-ilb3t36swgzq6v1l
MergeĀ lp:bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
318
318
        self.test_case_server = test_case_server
319
319
        self._home_dir = test_case_server._home_dir
320
320
 
321
 
    def tearDown(self):
 
321
    def stop_server(self):
322
322
         """Called to clean-up the server.
323
323
 
324
324
         Since the server may be (surely is, even) in a blocking listen, we
347
347
             # 'Socket is not connected' can also occur on OSX, with a
348
348
             # "regular" ENOTCONN (when something went wrong during test case
349
349
             # setup leading to self.setUp() *not* being called but
350
 
             # self.tearDown() still being called -- vila20081106
 
350
             # self.stop_server() still being called -- vila20081106
351
351
             if not len(e.args) or e.args[0] not in (errno.ENOTCONN, 10057):
352
352
                 raise
353
353
         # Let the server properly close the socket
521
521
        """Capture Server log output."""
522
522
        self.logs.append(format % args)
523
523
 
524
 
    def setUp(self, backing_transport_server=None):
525
 
        """See bzrlib.transport.Server.setUp.
 
524
    def start_server(self, backing_transport_server=None):
 
525
        """See bzrlib.transport.Server.start_server.
526
526
 
527
527
        :param backing_transport_server: The transport that requests over this
528
528
            protocol should be forwarded to. Note that this is currently not
557
557
        self._http_starting.release()
558
558
        self.logs = []
559
559
 
560
 
    def tearDown(self):
561
 
        """See bzrlib.transport.Server.tearDown."""
562
 
        self._httpd.tearDown()
 
560
    def stop_server(self):
 
561
        self._httpd.stop_server()
563
562
        self._http_running = False
564
563
        # We don't need to 'self._http_thread.join()' here since the thread is
565
564
        # a daemonic one and will be garbage collected anyway. Joining just