'When L{FileBodyProducer} reaches end-of-file on the input file given to
it, the input file is closed.'

def test_inputClosedAtEOF(self):

    readSize = 4
    inputBytes = 'some    friendly    bytes'
    inputFile = BytesIO(inputBytes)
    producer = FileBodyProducer(inputFile, self.cooperator, readSize)
    consumer = FileConsumer(BytesIO())
    producer.startProducing(consumer)
    for i in range(((len(inputBytes) // readSize) + 2)):
        self._scheduled.pop(0)()
    self.assertTrue(inputFile.closed)
