'Check rotated files have same permissions as original.'

def test_modePreservation(self):

    open(self.path, 'w').close()
    os.chmod(self.path, 455)
    mode = os.stat(self.path)[stat.ST_MODE]
    log = logfile.LogFile(self.name, self.dir)
    self.addCleanup(log.close)
    log.write('abc')
    log.rotate()
    self.assertEqual(mode, os.stat(self.path)[stat.ST_MODE])
