'L{http.Request.finish} will call the channel\'s factory to produce a log
message.'

def test_finishProducesLog(self):

    factory = http.HTTPFactory()
    factory.timeOut = None
    factory._logDateTime = 'sometime'
    factory._logDateTimeCall = True
    factory.startFactory()
    factory.logFile = BytesIO()
    proto = factory.buildProtocol(None)
    val = ['GET    /path    HTTP/1.1\r\n', '\r\n\r\n']
    trans = StringTransport()
    proto.makeConnection(trans)
    for x in val:
        proto.dataReceived(x)
    proto._channel.requests[0].finish()
    self.assertIn('sometime    "GET    /path    HTTP/1.1"', factory.logFile.getvalue())
