summaryrefslogtreecommitdiff
path: root/summainlib_tests.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2010-01-01 03:02:20 +0200
committerLars Wirzenius <liw@liw.fi>2010-01-01 03:02:20 +0200
commit37810eaf498b82c8fb54bcf22c0861ad2c370d69 (patch)
tree9c6446dcfddb4c109c2d3389aa176d2adc781058 /summainlib_tests.py
parent769ff2d2dd5434cec535a8ff4be9a9ba3a81e4bf (diff)
downloadsummain-37810eaf498b82c8fb54bcf22c0861ad2c370d69.tar.gz
Implement formatting of st_gid.
Implement lookup of group name corresponding to st_gid. With unit tests.
Diffstat (limited to 'summainlib_tests.py')
-rw-r--r--summainlib_tests.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/summainlib_tests.py b/summainlib_tests.py
index db2e6b5..b88f7b8 100644
--- a/summainlib_tests.py
+++ b/summainlib_tests.py
@@ -36,7 +36,8 @@ class FilesystemObjectTests(unittest.TestCase):
st_dev=42,
st_nlink=2,
st_size=1,
- st_uid=0)
+ st_uid=0,
+ st_gid=0)
def new(self, name):
return summainlib.FilesystemObject(name, stat_result=self.st)
@@ -72,3 +73,9 @@ class FilesystemObjectTests(unittest.TestCase):
def test_formats_username_correctly(self):
self.assertEqual(self.new('foo')['Username'], 'root')
+ def test_formats_gid_correctly(self):
+ self.assertEqual(self.new('foo')['Gid'], '0')
+
+ def test_formats_group_correctly(self):
+ self.assertEqual(self.new('foo')['Group'], 'root')
+