Skip to content
This repository was archived by the owner on Jun 28, 2024. It is now read-only.

Commit 47d1597

Browse files
authored
fix: Merge pull request #38 from seamapi/fix-35
fix #35: Reset Workspace endpoint now returns success message
2 parents 1d60a46 + 593770b commit 47d1597

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

seamapi/types.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,3 +255,9 @@ class AbstractSeam(abc.ABC):
255255
@abc.abstractmethod
256256
def __init__(self, api_key: Optional[str] = None):
257257
raise NotImplementedError
258+
259+
@dataclass_json
260+
@dataclass
261+
class ResetSandBoxResponse:
262+
message: str
263+
ok: bool

seamapi/workspaces.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
AbstractWorkspaces,
44
Workspace,
55
WorkspaceId,
6+
ResetSandBoxResponse,
67
)
78
from typing import Optional, List, Union
89
import requests
@@ -129,7 +130,7 @@ def reset_sandbox(self) -> None:
129130
130131
Returns
131132
------
132-
None
133+
ResetSandBoxResponse
133134
"""
134135

135136
res = requests.post(
@@ -138,4 +139,8 @@ def reset_sandbox(self) -> None:
138139
)
139140
if not res.ok:
140141
raise Exception(res.text)
141-
return None
142+
143+
return ResetSandBoxResponse(
144+
message="Successfully reset workspace sandbox",
145+
ok=True,
146+
)

tests/workspaces/test_workspaces.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def test_workspaces(seam: Seam):
99
assert ws.is_sandbox == True
1010

1111
reset_sandbox_result = seam.workspaces.reset_sandbox()
12-
assert reset_sandbox_result is None
12+
assert reset_sandbox_result is not None
1313

1414
ws_list = seam.workspaces.list()
1515
assert len(ws_list) > 0

0 commit comments

Comments
 (0)