~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/http_server.py

  • Committer: John Arbash Meinel
  • Date: 2008-10-30 00:55:00 UTC
  • mto: (3815.2.5 prepare-1.9)
  • mto: This revision was merged to the branch mainline in revision 3811.
  • Revision ID: john@arbash-meinel.com-20081030005500-r5cej1cxflqhs3io
Switch so that we are using a simple timestamp as the first action.

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
23
24
import SimpleHTTPServer
24
25
import socket
25
26
import SocketServer
418
419
        # Allows tests to verify number of GET requests issued
419
420
        self.GET_request_nb = 0
420
421
 
 
422
    def __repr__(self):
 
423
        return "%s(%s:%s)" % \
 
424
            (self.__class__.__name__, self.host, self.port)
 
425
 
421
426
    def _get_httpd(self):
422
427
        if self._httpd is None:
423
428
            rhandler = self.request_handler
467
472
                httpd.handle_request()
468
473
            except socket.timeout:
469
474
                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
470
483
 
471
484
    def _get_remote_url(self, path):
472
485
        path_parts = path.split(os.path.sep)