-
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.
Signed-off-by: flashdagger <flashdagger@googlemail.com>
- Loading branch information
1 parent
ab1a1a2
commit 9da13ab
Showing
5 changed files
with
37 additions
and
2 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,24 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: UTF-8 -*- | ||
|
||
|
||
import pytest | ||
|
||
|
||
def test_roles_create_but_cannot_delete(rclient): | ||
role = rclient.roles(3) | ||
assert role.name == "Customer" | ||
|
||
properties = dict(role.view()) | ||
properties["name"] = "Clone: Customer" | ||
new_role = rclient.roles.create(**properties) | ||
|
||
with pytest.raises(NotImplementedError, match="roles cannot be deletet"): | ||
new_role.delete() | ||
|
||
|
||
def test_role_update(rclient): | ||
role = rclient.roles(7) | ||
assert role.name == "Clone: Customer" | ||
updated_role = role.update(active=False) | ||
assert updated_role.active is False |
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,4 @@ | ||
{"method": "GET", "url": "https://localhost/api/v1/roles/7", "status_code": 200, "reason": "OK", "headers": {"Content-Type": "application/json; charset=utf-8", "Content-Length": "341"}, "encoding": "utf-8", "content_size": 341} | ||
{"id":7,"name":"Clone: Customer","preferences":{},"default_at_signup":true,"active":true,"note":"People who create Tickets ask for help.","updated_by_id":3,"created_by_id":3,"created_at":"2023-10-27T04:10:36.048Z","updated_at":"2023-10-27T04:10:36.044Z","permission_ids":[44,47,48,50,54,58],"knowledge_base_permission_ids":[],"group_ids":{}} | ||
{"method": "PUT", "url": "https://localhost/api/v1/roles/7", "status_code": 200, "reason": "OK", "headers": {"Content-Type": "application/json; charset=utf-8", "Content-Length": "342"}, "encoding": "utf-8", "content_size": 342} | ||
{"active":false,"updated_by_id":3,"id":7,"name":"Clone: Customer","preferences":{},"default_at_signup":true,"note":"People who create Tickets ask for help.","created_by_id":3,"created_at":"2023-10-27T04:10:36.048Z","updated_at":"2023-10-27T04:14:25.749Z","permission_ids":[44,47,48,50,54,58],"knowledge_base_permission_ids":[],"group_ids":{}} |
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,4 @@ | ||
{"method": "GET", "url": "https://localhost/api/v1/roles/3", "status_code": 200, "reason": "OK", "headers": {"Content-Type": "application/json; charset=utf-8", "Content-Length": "334"}, "encoding": "utf-8", "content_size": 334} | ||
{"id":3,"name":"Customer","preferences":{},"default_at_signup":true,"active":true,"note":"People who create Tickets ask for help.","updated_by_id":3,"created_by_id":1,"created_at":"2023-09-22T20:15:52.744Z","updated_at":"2023-09-23T03:23:14.777Z","permission_ids":[44,47,48,50,54,58],"knowledge_base_permission_ids":[],"group_ids":{}} | ||
{"method": "POST", "url": "https://localhost/api/v1/roles", "status_code": 201, "reason": "Created", "headers": {"Content-Type": "application/json; charset=utf-8", "Content-Length": "341"}, "encoding": "utf-8", "content_size": 341} | ||
{"id":7,"name":"Clone: Customer","preferences":{},"default_at_signup":true,"active":true,"note":"People who create Tickets ask for help.","updated_by_id":3,"created_by_id":3,"created_at":"2023-10-27T04:10:36.048Z","updated_at":"2023-10-27T04:10:36.044Z","permission_ids":[44,47,48,50,54,58],"knowledge_base_permission_ids":[],"group_ids":{}} |
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