~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/http_server.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-06-05 04:05:05 UTC
  • mfrom: (3473.1.1 ianc-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20080605040505-i9kqxg2fps2qjdi0
Add the 'alias' command (Tim Penhey)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import posixpath
21
21
import random
22
22
import re
23
 
import select
24
23
import SimpleHTTPServer
25
24
import socket
26
25
import SocketServer
419
418
        # Allows tests to verify number of GET requests issued
420
419
        self.GET_request_nb = 0
421
420
 
422
 
    def __repr__(self):
423
 
        return "%s(%s:%s)" % \
424
 
            (self.__class__.__name__, self.host, self.port)
425
 
 
426
421
    def _get_httpd(self):
427
422
        if self._httpd is None:
428
423
            rhandler = self.request_handler
472
467
                httpd.handle_request()
473
468
            except socket.timeout:
474
469
                pass
475
 
            except (socket.error, select.error), e:
476
 
               if e[0] == errno.EBADF:
477
 
                   # Starting with python-2.6, handle_request may raise socket
478
 
                   # or select exceptions when the server is shut down (as we
479
 
                   # do).
480
 
                   pass
481
 
               else:
482
 
                   raise
483
470
 
484
471
    def _get_remote_url(self, path):
485
472
        path_parts = path.split(os.path.sep)