-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Role names in access_rights are passing check_rights_axioms
- Loading branch information
Showing
4 changed files
with
92 additions
and
25 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
Empty file.
40 changes: 40 additions & 0 deletions
40
tests/dynamic_data/publications/access_rights/test_role.py
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,40 @@ | ||
from tests import EnumTestTypes, Publication | ||
from tests.asserts.final.publication import util as assert_util | ||
from tests.dynamic_data import base_test, base_test_classes | ||
from tests.dynamic_data.publications import common_publications | ||
|
||
pytest_generate_tests = base_test.pytest_generate_tests | ||
|
||
|
||
class PublicationTypes(base_test_classes.PublicationByDefinitionBase): | ||
LAYER = (common_publications.LAYER_VECTOR_SLD, 'layer') | ||
MAP = (common_publications.MAP_EMPTY, 'map') | ||
|
||
|
||
class TestPublication(base_test.TestSingleRestPublication): | ||
workspace = 'test_access_rights_role' | ||
publication_type = None | ||
|
||
rest_parametrization = [ | ||
base_test_classes.RestMethod, | ||
PublicationTypes, | ||
] | ||
|
||
test_cases = [base_test.TestCaseType(key='role_test', | ||
publication=lambda publ_def, cls: Publication(cls.workspace, | ||
publ_def.type, | ||
None), | ||
rest_args={ | ||
'access_rights': { | ||
'read': 'EVERYONE,ROLE1' | ||
} | ||
}, | ||
type=EnumTestTypes.OPTIONAL, | ||
specific_types={ | ||
(base_test_classes.RestMethod.POST, PublicationTypes.LAYER): EnumTestTypes.MANDATORY | ||
}, | ||
)] | ||
|
||
def test_publication(self, publication, rest_method, rest_args): | ||
rest_method.fn(publication, args=rest_args) | ||
assert_util.is_publication_valid_and_complete(publication) |