-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_utils.py
More file actions
21 lines (15 loc) · 866 Bytes
/
test_utils.py
File metadata and controls
21 lines (15 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from scim2_models import Context
from scim2_models import GroupMember
from scim2_models import User
from scim2_cli.utils import is_field_acceptable
def test_is_field_acceptable():
assert is_field_acceptable(Context.RESOURCE_CREATION_REQUEST, User, "user_name")
assert not is_field_acceptable(Context.RESOURCE_CREATION_REQUEST, User, "id")
assert is_field_acceptable(Context.RESOURCE_QUERY_REQUEST, User, "user_name")
assert not is_field_acceptable(Context.RESOURCE_QUERY_REQUEST, User, "password")
assert is_field_acceptable(Context.SEARCH_REQUEST, User, "user_name")
assert not is_field_acceptable(Context.SEARCH_REQUEST, User, "password")
assert is_field_acceptable(Context.RESOURCE_REPLACEMENT_REQUEST, User, "password")
assert not is_field_acceptable(
Context.RESOURCE_REPLACEMENT_REQUEST, GroupMember, "type"
)