Skip to content

Commit b4e45ca

Browse files
committed
Add test
1 parent 268a122 commit b4e45ca

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

fishjam/api/_fishjam_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
PeerConfig,
2727
PeerDetailsResponse,
2828
PeerOptionsAgent,
29-
PeerOptionsWebRTC,
3029
PeerOptionsVapi,
30+
PeerOptionsWebRTC,
3131
PeerRefreshTokenResponse,
3232
PeerType,
3333
RoomConfig,

scripts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def check_exit_code(command):
2424
if exit_code != 0:
2525
sys.exit(exit_code)
2626

27+
2728
def run_tests():
2829
check_exit_code("uv run pytest")
2930

tests/test_room_api.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
FishjamClient,
88
Peer,
99
PeerOptions,
10+
PeerOptionsVapi,
1011
Room,
1112
RoomOptions,
1213
)
@@ -251,6 +252,27 @@ def test_peer_limit_reached(self, room_api: FishjamClient):
251252
room_api.create_peer(room.id)
252253

253254

255+
class TestCreateVapiAgent:
256+
def test_create_vapi_agent(self, room_api: FishjamClient):
257+
room = room_api.create_room()
258+
options = PeerOptionsVapi(api_key="test_api_key", call_id="test_call_id")
259+
peer = room_api.create_vapi_agent(room.id, options=options)
260+
261+
assert peer.type_ == PeerType.VAPI
262+
263+
room = room_api.get_room(room.id)
264+
assert any(p.id == peer.id for p in room.peers)
265+
266+
def test_delete_vapi_agent(self, room_api: FishjamClient):
267+
room = room_api.create_room()
268+
options = PeerOptionsVapi(api_key="test_api_key", call_id="test_call_id")
269+
peer = room_api.create_vapi_agent(room.id, options=options)
270+
271+
room_api.delete_peer(room.id, peer.id)
272+
273+
assert [] == room_api.get_room(room.id).peers
274+
275+
254276
class TestDeletePeer:
255277
def test_valid(self, room_api: FishjamClient):
256278
room = room_api.create_room()

0 commit comments

Comments
 (0)