Skip to content

Commit e0ed746

Browse files
more
1 parent 9dc8d6f commit e0ed746

File tree

2 files changed

+29
-9
lines changed

2 files changed

+29
-9
lines changed

src/workos/authorization.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,6 @@
44
from pydantic import TypeAdapter
55
from typing_extensions import TypedDict
66

7-
8-
class _Unset(Enum):
9-
"""Sentinel to distinguish 'not provided' from an explicit None."""
10-
11-
TOKEN = 0
12-
13-
14-
UNSET: _Unset = _Unset.TOKEN
15-
167
from workos.types.authorization.environment_role import (
178
EnvironmentRole,
189
EnvironmentRoleList,
@@ -39,6 +30,13 @@ class _Unset(Enum):
3930
REQUEST_METHOD_PUT,
4031
)
4132

33+
class _Unset(Enum):
34+
35+
TOKEN = 0
36+
37+
38+
UNSET: _Unset = _Unset.TOKEN
39+
4240
AUTHORIZATION_PERMISSIONS_PATH = "authorization/permissions"
4341
AUTHORIZATION_RESOURCES_PATH = "authorization/resources"
4442

tests/test_authorization_resource_crud.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,28 @@ def test_update_resource_without_meta(
204204
assert request_kwargs["method"] == "patch"
205205
assert request_kwargs["json"] == {}
206206

207+
208+
def test_update_resource_without_desc(
209+
self, mock_resource, capture_and_mock_http_client_request
210+
):
211+
request_kwargs = capture_and_mock_http_client_request(
212+
self.http_client, mock_resource, 200
213+
)
214+
215+
resource = syncify(
216+
self.authorization.update_resource(
217+
"res_01ABC",
218+
name="Updated Name",
219+
)
220+
)
221+
222+
assert resource.id == "res_01ABC"
223+
assert request_kwargs["method"] == "patch"
224+
assert request_kwargs["url"].endswith("/authorization/resources/res_01ABC")
225+
assert request_kwargs["json"] == {
226+
"name": "Updated Name"
227+
}
228+
207229
# --- delete_resource ---
208230

209231
def test_delete_resource_without_cascade(

0 commit comments

Comments
 (0)