forked from redcap-tools/PyCap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
17e9ca6
commit 7961acd
Showing
5 changed files
with
102 additions
and
0 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
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 |
---|---|---|
|
@@ -112,6 +112,37 @@ def test_export_users(simple_project): | |
assert users[0]["api_export"] == 1 | ||
|
||
|
||
@pytest.mark.integration | ||
def test_export_user_roles(simple_project): | ||
user_roles = simple_project.export_user_roles() | ||
assert len(user_roles) == 1 | ||
assert user_roles[0]["role_label"] == "Example Role" | ||
|
||
|
||
@pytest.mark.integration | ||
def test_export_import_user_role_assignments(simple_project): | ||
new_user = "[email protected]" | ||
simple_project.import_users([{"username": new_user}]) | ||
|
||
example_role_name = simple_project.export_user_roles()[0]["unique_role_name"] | ||
|
||
res = simple_project.import_user_role_assignment( | ||
[{"username": new_user, "unique_role_name": example_role_name}] | ||
) | ||
assert res == 1 | ||
|
||
user_role_assignments = simple_project.export_user_role_assignment() | ||
test_user_role_name = [ | ||
user_role["unique_role_name"] | ||
for user_role in user_role_assignments | ||
if user_role["username"] == new_user | ||
][0] | ||
assert test_user_role_name == example_role_name | ||
# cleanup | ||
res = simple_project.delete_users([new_user]) | ||
assert res == 1 | ||
|
||
|
||
@pytest.mark.integration | ||
def test_export_dags(simple_project): | ||
dags = simple_project.export_dags(format_type="df") | ||
|
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