Skip to content

Commit 4385731

Browse files
committed
Fix lint issues
1 parent e9647d7 commit 4385731

File tree

3 files changed

+30
-27
lines changed

3 files changed

+30
-27
lines changed

jellyfish/__init__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,18 @@
1111
from jellyfish._openapi_client.models import (
1212
ComponentFile,
1313
ComponentHLS,
14-
ComponentSIP,
15-
ComponentRTSP,
1614
ComponentOptionsFile,
1715
ComponentOptionsHLS,
1816
ComponentOptionsHLSSubscribeMode,
19-
ComponentOptionsSIP,
2017
ComponentOptionsRTSP,
18+
ComponentOptionsSIP,
2119
ComponentPropertiesFile,
2220
ComponentPropertiesHLS,
2321
ComponentPropertiesHLSSubscribeMode,
24-
ComponentPropertiesSIP,
2522
ComponentPropertiesRTSP,
26-
Credentials,
23+
ComponentPropertiesSIP,
24+
ComponentRTSP,
25+
ComponentSIP,
2726
Peer,
2827
PeerOptionsWebRTC,
2928
PeerStatus,

jellyfish/api/_room_api.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
from typing import Literal, Union
66

77
from jellyfish._openapi_client.api.hls import subscribe_hls_to as hls_subscribe_hls_to
8-
from jellyfish._openapi_client.api.sip import dial as sip_dial
9-
from jellyfish._openapi_client.api.sip import end_call as sip_end_call
108
from jellyfish._openapi_client.api.room import add_component as room_add_component
119
from jellyfish._openapi_client.api.room import add_peer as room_add_peer
1210
from jellyfish._openapi_client.api.room import create_room as room_create_room
@@ -15,17 +13,19 @@
1513
from jellyfish._openapi_client.api.room import delete_room as room_delete_room
1614
from jellyfish._openapi_client.api.room import get_all_rooms as room_get_all_rooms
1715
from jellyfish._openapi_client.api.room import get_room as room_get_room
16+
from jellyfish._openapi_client.api.sip import dial as sip_dial
17+
from jellyfish._openapi_client.api.sip import end_call as sip_end_call
1818
from jellyfish._openapi_client.models import (
1919
AddComponentJsonBody,
2020
AddPeerJsonBody,
2121
ComponentFile,
22-
ComponentOptionsFile,
23-
ComponentSIP,
24-
ComponentOptionsSIP,
2522
ComponentHLS,
23+
ComponentOptionsFile,
2624
ComponentOptionsHLS,
27-
ComponentRTSP,
2825
ComponentOptionsRTSP,
26+
ComponentOptionsSIP,
27+
ComponentRTSP,
28+
ComponentSIP,
2929
Peer,
3030
PeerOptionsWebRTC,
3131
Room,
@@ -127,7 +127,12 @@ def delete_peer(self, room_id: str, peer_id: str) -> None:
127127
def add_component(
128128
self,
129129
room_id: str,
130-
options: Union[ComponentOptionsFile, ComponentOptionsHLS, ComponentOptionsRTSP, ComponentOptionsSIP],
130+
options: Union[
131+
ComponentOptionsFile,
132+
ComponentOptionsHLS,
133+
ComponentOptionsRTSP,
134+
ComponentOptionsSIP,
135+
],
131136
) -> Union[ComponentFile, ComponentHLS, ComponentRTSP, ComponentSIP]:
132137
"""Creates component in the room"""
133138

@@ -177,8 +182,9 @@ def sip_dial(self, room_id: str, component_id: str, phone_number: str):
177182
"""
178183
Starts a phone call from a specified component to a provided phone number.
179184
180-
This is asynchronous operation.
181-
In case of providing incorrect phone number you will receive a notification `ComponentCrashed`.
185+
This is asynchronous operation.
186+
In case of providing incorrect phone number you will receive
187+
notification `ComponentCrashed`.
182188
"""
183189

184190
return self._request(

tests/test_room_api.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
ComponentOptionsHLS,
1515
ComponentOptionsHLSSubscribeMode,
1616
ComponentOptionsRTSP,
17+
ComponentOptionsSIP,
1718
ComponentPropertiesFile,
1819
ComponentPropertiesHLS,
1920
ComponentPropertiesHLSSubscribeMode,
2021
ComponentPropertiesRTSP,
21-
ComponentRTSP,
22-
ComponentOptionsSIP,
2322
ComponentPropertiesSIP,
23+
ComponentRTSP,
2424
ComponentSIP,
2525
Credentials,
2626
Peer,
@@ -66,17 +66,15 @@
6666
pierce_nat=True,
6767
)
6868

69-
SIP_PHONE_NUMBER="1234"
70-
71-
SIP_CREDENTIALS=Credentials(address="my-sip-registrar.net",username="user-name",password="pass-word")
69+
SIP_PHONE_NUMBER = "1234"
7270

73-
SIP_OPTIONS = ComponentOptionsSIP(
74-
registrar_credentials=SIP_CREDENTIALS
75-
)
76-
SIP_PROPERTIES = ComponentPropertiesSIP(
77-
registrar_credentials=SIP_CREDENTIALS
71+
SIP_CREDENTIALS = Credentials(
72+
address="my-sip-registrar.net", username="user-name", password="pass-word"
7873
)
7974

75+
SIP_OPTIONS = ComponentOptionsSIP(registrar_credentials=SIP_CREDENTIALS)
76+
SIP_PROPERTIES = ComponentPropertiesSIP(registrar_credentials=SIP_CREDENTIALS)
77+
8078
FILE_OPTIONS = ComponentOptionsFile(file_path="video.h264")
8179
FILE_PROPERTIES = ComponentPropertiesFile(
8280
file_path=FILE_OPTIONS.file_path, framerate=30
@@ -314,19 +312,19 @@ def test_invalid_subscription_in_auto_mode(self, room_api: RoomApi):
314312
== "HLS component option `subscribe_mode` is set to :auto"
315313
)
316314

315+
317316
class TestSIPCall:
318317
def test_happy_path(self, room_api: RoomApi):
319318
_, room = room_api.create_room(video_codec=CODEC_H264)
320319
component = room_api.add_component(
321320
room.id,
322-
options=ComponentOptionsSIP(
323-
registrar_credentials=SIP_CREDENTIALS
324-
),
321+
options=ComponentOptionsSIP(registrar_credentials=SIP_CREDENTIALS),
325322
)
326323
assert room_api.sip_dial(room.id, component.id, SIP_PHONE_NUMBER) is None
327324

328325
assert room_api.sip_end_call(room.id, component.id) is None
329326

327+
330328
class TestAddPeer:
331329
def _assert_peer_created(self, room_api, webrtc_peer, room_id):
332330
peer = Peer(

0 commit comments

Comments
 (0)