summaryrefslogtreecommitdiff
path: root/summainlib_tests.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2010-01-01 02:55:21 +0200
committerLars Wirzenius <liw@liw.fi>2010-01-01 02:55:21 +0200
commit3a5fc4f3da2165faf615b96b16b40bfc2a330281 (patch)
tree5d74941fc53b0301c3d11213ec5d7ecd3c241d39 /summainlib_tests.py
parent5c8f4e685a147cf7fe33b97c70673928d1485db5 (diff)
downloadsummain-3a5fc4f3da2165faf615b96b16b40bfc2a330281.tar.gz
Implement st_size formatting. With unit test.
Diffstat (limited to 'summainlib_tests.py')
-rw-r--r--summainlib_tests.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/summainlib_tests.py b/summainlib_tests.py
index b9849d2..2eb3119 100644
--- a/summainlib_tests.py
+++ b/summainlib_tests.py
@@ -34,7 +34,8 @@ class FilesystemObjectTests(unittest.TestCase):
st_mode=stat.S_IFREG | 0644,
st_ino=12765,
st_dev=42,
- st_nlink=2)
+ st_nlink=2,
+ st_size=1)
def new(self, name):
return summainlib.FilesystemObject(name, stat_result=self.st)
@@ -61,3 +62,6 @@ class FilesystemObjectTests(unittest.TestCase):
def test_formats_link_count_correctly(self):
self.assertEqual(self.new('foo')['Nlink'], '2')
+ def test_formats_size_correctly(self):
+ self.assertEqual(self.new('foo')['Size'], '1')
+