예제 #1
0
    def test_getattr_with_correct_path(self):
        view = IndexView(**{'uid': 1, 'gid': 1, 'mount_time': "now"})
        result = view.getattr("/", 1)

        asserted_result = {
            'st_mode': S_IFDIR | 0o555,
            'st_nlink': 2,
            'st_uid': 1,
            'st_gid': 1,
            'st_ctime': "now",
            'st_mtime': "now",
        }
        assert result == asserted_result
예제 #2
0
    def test_getattr_with_correct_path(self):
        view = IndexView(**{"uid": 1, "gid": 1, "mount_time": "now"})
        result = view.getattr("/", 1)

        asserted_result = {
            "st_mode": S_IFDIR | 0o555,
            "st_nlink": 2,
            "st_uid": 1,
            "st_gid": 1,
            "st_ctime": "now",
            "st_mtime": "now",
        }
        assert result == asserted_result
예제 #3
0
    def test_getattr_with_correct_path(self):
        view = IndexView(**{
            'uid': 1,
            'gid': 1,
            'mount_time': "now"
        })
        result = view.getattr("/", 1)

        asserted_result = {
            'st_mode': S_IFDIR | 0555,
            'st_nlink': 2,
            'st_uid': 1,
            'st_gid': 1,
            'st_ctime': "now",
            'st_mtime': "now",
        }
예제 #4
0
 def test_readdir(self):
     view = IndexView()
     assert view.readdir("path", 1) == ['.', '..', 'current', 'history']
예제 #5
0
    def test_getattr_with_non_root_path(self):
        view = IndexView()

        with pytest.raises(FuseOSError):
            view.getattr("/path")
예제 #6
0
 def test_readdir(self):
     view = IndexView()
     assert view.readdir("path", 1) == [".", "..", "current", "history"]