def testFile(self): entry = jobs_pb2.StatEntry() entry.pathspec.path = 'foo' entry.st_mode = 33188 self.assertEqual(stat.name(entry), 'foo')
def testSymlink(self): entry = jobs_pb2.StatEntry() entry.pathspec.path = 'foo' entry.symlink = 'bar' self.assertEqual(stat.name(entry), 'foo -> bar')
def __init__(self, stat_entry): self.size = stat.size(stat_entry) self.abs_path = os.path.normpath(stat_entry.pathspec.path) self.name = stat.name(stat_entry) self.icon = stat.icon(stat_entry) self.mode = stat.mode(stat_entry)