summaryrefslogtreecommitdiff
path: root/summainlib_tests.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2010-01-01 02:48:09 +0200
committerLars Wirzenius <liw@liw.fi>2010-01-01 02:48:09 +0200
commit550106cec6a5f5522517044b3e86997aac1cb33d (patch)
treeb9a1f60d971bef3f4ef7746597b9a20725d13960 /summainlib_tests.py
parent782cf82eb8e4d66359853b8ad086448d3eb1b701 (diff)
downloadsummain-550106cec6a5f5522517044b3e86997aac1cb33d.tar.gz
Implement formatting of st_mode.
Change unit test to include bit for regular files. Since the actual formatting code is so simple, no other file types will be tested.
Diffstat (limited to 'summainlib_tests.py')
-rw-r--r--summainlib_tests.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/summainlib_tests.py b/summainlib_tests.py
index a899e61..d05e293 100644
--- a/summainlib_tests.py
+++ b/summainlib_tests.py
@@ -30,7 +30,8 @@ class FakeStatResult(object):
class FilesystemObjectTests(unittest.TestCase):
def setUp(self):
- self.st = FakeStatResult(st_mtime=1262307723)
+ self.st = FakeStatResult(st_mtime=1262307723,
+ st_mode=stat.S_IFREG | 0644)
def new(self, name):
return summainlib.FilesystemObject(name, stat_result=self.st)
@@ -46,6 +47,5 @@ class FilesystemObjectTests(unittest.TestCase):
'2010-01-01 01:02:03 +0000')
def test_formats_mode_for_regular_file_correctly(self):
- self.st.st_mode = stat.S_IFREG | 0644
- self.assertEqual(self.new('foo')['Mode'], '644')
+ self.assertEqual(self.new('foo')['Mode'], '100644')