~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/HTTPTestUtil.py

[merge] up-to-date against bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
import BaseHTTPServer, SimpleHTTPServer, socket, errno, time
18
 
from bzrlib.selftest import TestCaseInTempDir
 
18
from bzrlib.tests import TestCaseInTempDir
19
19
 
20
20
 
21
21
class WebserverNotAvailable(Exception):
27
27
 
28
28
class TestingHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
29
29
    def log_message(self, format, *args):
30
 
        self.server.test_case.log("webserver - %s - - [%s] %s" %
31
 
                                  (self.address_string(),
32
 
                                   self.log_date_time_string(),
33
 
                                   format%args))
 
30
        self.server.test_case.log("webserver - %s - - [%s] %s",
 
31
                                  self.address_string(),
 
32
                                  self.log_date_time_string(),
 
33
                                  format%args)
34
34
 
35
35
    def handle_one_request(self):
36
36
        """Handle a single HTTP request.
44
44
            try:
45
45
                self.raw_requestline = self.rfile.readline()
46
46
            except socket.error, e:
47
 
                if e.args[0] == errno.EAGAIN:
 
47
                if e.args[0] in (errno.EAGAIN, errno.EWOULDBLOCK):
48
48
                    # omitted for now because some tests look at the log of
49
49
                    # the server and expect to see no errors.  see recent
50
50
                    # email thread. -- mbp 20051021.