def testDirectory(self): entry = jobs_pb2.StatEntry() entry.pathspec.path = '/foo/bar' entry.st_size = 42 entry.st_mode = 16877 out = io.StringIO() pp = pretty.PrettyPrinter(out) representer.stat_entry_pretty(entry, pp, cycle=False) expected = '📂 bar (drwxr-xr-x /foo/bar, {})' expected = expected.format(humanize.naturalsize(42)) self.assertEqual(out.getvalue(), expected)
def testFile(self): entry = jobs_pb2.StatEntry() entry.pathspec.path = '/foo/bar' entry.st_size = 42 entry.st_mode = 33188 out = StringIO() pp = pretty.PrettyPrinter(out) representer.stat_entry_pretty(entry, pp, cycle=False) expected = '📄 bar (-rw-r--r-- /foo/bar, {})' expected = expected.format(humanize.naturalsize(42)) self.assertEqual(out.getvalue(), expected)