summaryrefslogtreecommitdiff
path: root/summainlib_tests.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2010-01-01 03:16:41 +0200
committerLars Wirzenius <liw@liw.fi>2010-01-01 03:16:41 +0200
commiteb85c7df4fcbeff0c28aeaa9329731dda9aace12 (patch)
tree57e3f17305803ae22cb54c29025d860ae1a812fb /summainlib_tests.py
parent2220cc038941de88a26b981e797c091f7869e8d5 (diff)
downloadsummain-eb85c7df4fcbeff0c28aeaa9329731dda9aace12.tar.gz
Fix SHA-1 computation so it is only done for regular
files.
Diffstat (limited to 'summainlib_tests.py')
-rw-r--r--summainlib_tests.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/summainlib_tests.py b/summainlib_tests.py
index a3553ca..cbfb11c 100644
--- a/summainlib_tests.py
+++ b/summainlib_tests.py
@@ -108,3 +108,7 @@ class FilesystemObjectTests(unittest.TestCase):
def test_formats_sha1_correctly_for_regular_file(self):
self.assertEqual(self.new('foo')['Sha-1'], 'abc')
+ def test_formats_sha1_correctly_for_special_file(self):
+ self.st.st_mode = stat.S_IFDIR | 0755
+ self.assertEqual(self.new('foo')['Sha-1'], '')
+