~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_http.py

  • Committer: Aaron Bentley
  • Date: 2006-12-15 02:47:54 UTC
  • mfrom: (2158.2.1 bzrw1.1)
  • mto: This revision was merged to the branch mainline in revision 2189.
  • Revision ID: aaron.bentley@utoronto.ca-20061215024754-u067jln0jl714fpp
Windows tests cleanup.  (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
        except socket.timeout:
113
113
            # Make sure the client isn't stuck waiting for us to e.g. accept.
114
114
            self._sock.close()
 
115
        except socket.error:
 
116
            # The client may have already closed the socket.
 
117
            pass
115
118
 
116
119
    def tearDown(self):
117
120
        try:
304
307
        self.assertEqual([[10, 12], [22, 26]], ranges)
305
308
 
306
309
 
307
 
class TestPost(TestCase):
 
310
class TestPost(object):
308
311
 
309
312
    def _test_post_body_is_received(self, scheme):
310
313
        server = RecordingServer(expect_body_tail='end-of-body')
325
328
        self.assertTrue(
326
329
            server.received_bytes.endswith('\r\n\r\nabc def end-of-body'))
327
330
 
 
331
 
 
332
class TestPost_urllib(TestCase, TestPost):
 
333
    """TestPost for urllib implementation"""
 
334
 
 
335
    _transport = HttpTransport_urllib
 
336
 
328
337
    def test_post_body_is_received_urllib(self):
329
338
        self._test_post_body_is_received('http+urllib')
330
339
 
 
340
 
 
341
class TestPost_pycurl(TestWithTransport_pycurl, TestCase, TestPost):
 
342
    """TestPost for pycurl implementation"""
 
343
 
331
344
    def test_post_body_is_received_pycurl(self):
332
345
        self._test_post_body_is_received('http+pycurl')
333
346