-
Notifications
You must be signed in to change notification settings - Fork 494
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow not retrieving user props for datasets (#15287)
- Loading branch information
Showing
2 changed files
with
30 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import pytest | ||
|
||
from middlewared.test.integration.assets.pool import dataset | ||
from middlewared.test.integration.utils import call | ||
|
||
|
||
@pytest.mark.parametrize('user_props', [True, False]) | ||
def test_pool_dataset_query_user_props_true_false(user_props): | ||
with dataset("query_test") as ds: | ||
result = call( | ||
"pool.dataset.query", | ||
[["id", "=", ds]], | ||
{"extra": {"flat": False, "properties": [], "retrieve_user_props": user_props}} | ||
) | ||
if user_props: | ||
assert "user_properties" in result[0], f"'user_properties' not found in result: {result}" | ||
else: | ||
assert "user_properties" not in result[0], f"'user_properties' found in result: {result}" |