Skip to content

Commit 1de269f

Browse files
Expand session profile update argument validation tests
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent c069bb8 commit 1de269f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/test_session_update_profile_params.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,24 @@ async def run() -> None:
9595

9696
_, payload = client.transport.calls[0]
9797
assert payload == {"type": "profile", "params": {"persistChanges": True}}
98+
99+
100+
def test_async_update_profile_params_rejects_conflicting_arguments():
101+
manager = AsyncSessionManager(_AsyncClient())
102+
103+
async def run() -> None:
104+
with pytest.raises(TypeError, match="not both"):
105+
await manager.update_profile_params(
106+
"session-1",
107+
UpdateSessionProfileParams(persist_changes=True),
108+
persist_changes=True,
109+
)
110+
111+
asyncio.run(run())
112+
113+
114+
def test_sync_update_profile_params_requires_argument_or_keyword():
115+
manager = SyncSessionManager(_SyncClient())
116+
117+
with pytest.raises(TypeError, match="requires either"):
118+
manager.update_profile_params("session-1")

0 commit comments

Comments
 (0)