Exemplo n.º 1
0
    def testFile(self):
        entry = jobs_pb2.StatEntry()
        entry.st_mode = 33188

        self.assertEqual(stat.icon(entry), '📄')
Exemplo n.º 2
0
    def testSymlinkPath(self):
        entry = jobs_pb2.StatEntry()
        entry.st_mode = 33188
        entry.symlink = 'foobar'

        self.assertEqual(stat.icon(entry), '🔗')
Exemplo n.º 3
0
    def testDirectory(self):
        entry = jobs_pb2.StatEntry()
        entry.st_mode = 16877

        self.assertEqual(stat.icon(entry), '📂')
Exemplo n.º 4
0
    def testSymlinkMode(self):
        entry = jobs_pb2.StatEntry()
        entry.st_mode = 41471

        self.assertEqual(stat.icon(entry), '🔗')
Exemplo n.º 5
0
 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)