'A header isn\'t processed by L{HTTPClient.extractHeader} until it is
confirmed in L{HTTPClient.lineReceived} that the header has been
received completely.'

def test_extractHeader(self):

    c = ClientDriver()
    c.handleHeader = self.ourHandleHeader
    c.handleEndHeaders = self.ourHandleEndHeaders
    c.lineReceived('HTTP/1.0    201')
    c.lineReceived('Content-Length:    10')
    self.assertIdentical(c.length, None)
    self.assertFalse(self.handleHeaderCalled)
    self.assertFalse(self.handleEndHeadersCalled)
    c.lineReceived('')
    self.assertTrue(self.handleHeaderCalled)
    self.assertTrue(self.handleEndHeadersCalled)
    self.assertEqual(c.length, 10)
