-
Notifications
You must be signed in to change notification settings - Fork 2
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
fb85aa7
commit de28893
Showing
3 changed files
with
86 additions
and
13 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from permit import Permit, PermitConnectionError, TenantCreate, UserCreate | ||
|
||
|
||
def abac_user(user: UserCreate): | ||
return user.dict(exclude={"first_name", "last_name"}) | ||
|
||
|
||
async def test_abac_pdp_cloud_error(permit_cloud: Permit): | ||
|
||
user_test = UserCreate( | ||
**dict( | ||
key="maya@permit.io", | ||
email="maya@permit.io", | ||
first_name="Maya", | ||
last_name="Barak", | ||
attributes={"age": 23}, | ||
) | ||
) | ||
TESLA = TenantCreate(key="tesla", name="Tesla Inc") | ||
|
||
try: | ||
resp = await permit_cloud.check( | ||
abac_user(user_test), | ||
"sign", | ||
{ | ||
"type": "document", | ||
"tenant": TESLA.key, | ||
"attributes": {"private": False}, | ||
}, | ||
) | ||
|
||
except Exception as error: | ||
assert isinstance(error, PermitConnectionError) |