'If a HTTP/1.1 client sends a \'Expect: 100-continue\' header, the server
responds with a 100 response code before handling the request body, if
any. The normal resource rendering code will then be called, which
will send an additional response code.'

def test_expect100ContinueHeader(self):

    transport = StringTransport()
    channel = http.HTTPChannel()
    channel.requestFactory = DummyHTTPHandlerProxy
    channel.makeConnection(transport)
    channel.dataReceived('GET    /    HTTP/1.1\r\n')
    channel.dataReceived('Host:    www.example.com\r\n')
    channel.dataReceived('Expect:    100-continue\r\n')
    channel.dataReceived('Content-Length:    3\r\n')
    self.assertEqual(transport.value(), '')
    channel.dataReceived('\r\n')
    self.assertEqual(transport.value(), 'HTTP/1.1    100    Continue\r\n\r\n')
    channel.dataReceived('abc')
    response = transport.value()
    self.assertTrue(response.startswith('HTTP/1.1    100    Continue\r\n\r\n'))
    response = response[len('HTTP/1.1    100    Continue\r\n\r\n'):]
    self.assertResponseEquals(response, [('HTTP/1.1    200    OK', 'Command:    GET', 'Content-Length:    13', 'Version:    HTTP/1.1', 'Request:    /', "'''\n3\nabc'''\n")])
