'Log files can be written to, closed. Their size is the number of
bytes written to them. Everything that was written to them can
be read, even if the writing happened on separate occasions,
and even if the log file was closed in between.'

def test_append(self):

    with contextlib.closing(logfile.LogFile(self.name, self.dir)) as log:
        log.write('0123456789')
    log = logfile.LogFile(self.name, self.dir)
    self.addCleanup(log.close)
    self.assertEqual(log.size, 10)
    self.assertEqual(log._file.tell(), log.size)
    log.write('abc')
    self.assertEqual(log.size, 13)
    self.assertEqual(log._file.tell(), log.size)
    f = log._file
    f.seek(0, 0)
    self.assertEqual(f.read(), '0123456789abc')
