Ejemplo n.º 1
0
    def test_list_perm(self):
        uids = (0, 1, 1000)
        gids = (0, 1, 1000)

        for u, g in itertools.product(uids, gids):
            node = DirectoryNode(0, 1, 0o750)

            if node.may_read(u, (g, )):
                node.list(u, (g, ))
            else:
                with pytest.raises(RootspacePermissionError):
                    node.list(u, (g, ))
Ejemplo n.º 2
0
    def test_list_value(self):
        parent = DirectoryNode(0, 0, 0o755)
        child = DirectoryNode(0, 0, 0o755, parent=parent)

        value = parent.list(0, (0, ))
        assert isinstance(value, dict)
        assert "." in value and ".." not in value
        assert isinstance(value["."], dict)
        assert value["."] == parent.stat(0, (0, ))

        value2 = child.list(0, (0, ))
        assert isinstance(value2, dict)
        assert "." in value2 and ".." in value2