mirror of
https://github.com/langgenius/dify.git
synced 2026-10-28 03:35:04 +08:00
feat: filter dataset operator and add miss permission key (#37867)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
autofix-ci[bot]
parent
d135dab241
commit
d87764b0f8
@@ -201,10 +201,10 @@ class TestPaginationMapping:
|
||||
},
|
||||
]
|
||||
assert response["pagination"] == {
|
||||
"total_count": 5,
|
||||
"total_count": 4,
|
||||
"per_page": 2,
|
||||
"current_page": 1,
|
||||
"total_pages": 3,
|
||||
"total_pages": 2,
|
||||
}
|
||||
mock_list.assert_not_called()
|
||||
|
||||
|
||||
@@ -86,21 +86,26 @@ class TestRoles:
|
||||
call = _call_args(mock_send)
|
||||
assert call.method == "GET"
|
||||
assert call.endpoint == "/rbac/roles"
|
||||
assert call.params == {"page_number": 2, "results_per_page": 50, "reverse": "true"}
|
||||
assert call.params == {
|
||||
"dataset_operator_enabled": False,
|
||||
"page_number": 2,
|
||||
"results_per_page": 50,
|
||||
"reverse": "true",
|
||||
}
|
||||
assert out.pagination
|
||||
assert out.pagination.total_count == 1
|
||||
|
||||
def test_list_omits_params_when_default(self, mock_send: MagicMock):
|
||||
mock_send.return_value = {"data": [], "pagination": None}
|
||||
svc.RBACService.Roles.list("tenant-1")
|
||||
assert _call_args(mock_send).params is None
|
||||
assert _call_args(mock_send).params is not None
|
||||
|
||||
def test_list_forwards_include_owner(self, mock_send: MagicMock):
|
||||
mock_send.return_value = {"data": [], "pagination": None}
|
||||
|
||||
svc.RBACService.Roles.list("tenant-1", include_owner=1)
|
||||
|
||||
assert _call_args(mock_send).params == {"include_owner": 1}
|
||||
assert _call_args(mock_send).params == {"dataset_operator_enabled": False, "include_owner": 1}
|
||||
|
||||
def test_list_coerces_null_permission_keys(self, mock_send: MagicMock):
|
||||
mock_send.return_value = {
|
||||
|
||||
Reference in New Issue
Block a user