diff options
-rw-r--r-- | tests/test_gettattr.py | 15 | ||||
-rw-r--r-- | vdrnfofs/filesystemnodes.py | 6 |
2 files changed, 17 insertions, 4 deletions
diff --git a/tests/test_gettattr.py b/tests/test_gettattr.py index 7bae140..321c8ac 100644 --- a/tests/test_gettattr.py +++ b/tests/test_gettattr.py @@ -34,5 +34,18 @@ class TestPathToNodeMapping(unittest.TestCase): def test_root(self): attr = self.fs.getattr('/') - self.assertEqual(stat.S_IFDIR | 0755, attr.st_mode) + self.assertEqual(stat.S_IFDIR | 0555, attr.st_mode) self.assertEqual(2 + 5, attr.st_nlink) + + def test_dir(self): + attr = self.fs.getattr('/folder') + self.assertEqual(stat.S_IFDIR | 0555, attr.st_mode) + self.assertEqual(2 + 6, attr.st_nlink) + + def test_mpg(self): + attr = self.fs.getattr('/sample_2008-03-28.20.13.99.99.rec.mpg') + self.assertEqual(stat.S_IFREG | 0444, attr.st_mode) + + def test_nfo(self): + attr = self.fs.getattr('/sample_2008-03-28.20.13.99.99.rec.nfo') + self.assertEqual(stat.S_IFREG | 0444, attr.st_mode) diff --git a/vdrnfofs/filesystemnodes.py b/vdrnfofs/filesystemnodes.py index 6902d9f..199e352 100644 --- a/vdrnfofs/filesystemnodes.py +++ b/vdrnfofs/filesystemnodes.py @@ -64,7 +64,7 @@ class MpgNode: def get_stat(self): attr = NodeAttributes() - attr.st_mode = stat.S_IFREG | 644 + attr.st_mode = stat.S_IFREG | stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH attr.st_nlink = 1 attr.st_size = self.size() return attr @@ -95,7 +95,7 @@ class NfoNode: def get_stat(self): attr = NodeAttributes() - attr.st_mode = stat.S_IFREG | 644 + attr.st_mode = stat.S_IFREG | stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH attr.st_nlink = 1 attr.st_size = self.size() return attr @@ -131,6 +131,6 @@ class DirNode: def get_stat(self): attr = NodeAttributes() - attr.st_mode = stat.S_IFDIR | 0755 + attr.st_mode = stat.S_IFDIR | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH | stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH attr.st_nlink = 2 + len(self.content()) return attr |