summaryrefslogtreecommitdiff
path: root/summainlib_tests.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2010-01-01 02:43:03 +0200
committerLars Wirzenius <liw@liw.fi>2010-01-01 02:43:03 +0200
commit782cf82eb8e4d66359853b8ad086448d3eb1b701 (patch)
tree676cb0392fc473c7daf5fe194d295a6debb4784a /summainlib_tests.py
parent63a1db8e90ab0e34ea722075d2cecfdf67297bcc (diff)
downloadsummain-782cf82eb8e4d66359853b8ad086448d3eb1b701.tar.gz
Add unit test for new mode field, for regular files.
Diffstat (limited to 'summainlib_tests.py')
-rw-r--r--summainlib_tests.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/summainlib_tests.py b/summainlib_tests.py
index 89e1caf..a899e61 100644
--- a/summainlib_tests.py
+++ b/summainlib_tests.py
@@ -14,6 +14,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+import stat
import unittest
import summainlib
@@ -43,3 +44,8 @@ class FilesystemObjectTests(unittest.TestCase):
def test_formats_mtime_correctly(self):
self.assertEqual(self.new('foo')['Mtime'],
'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')
+