@@ -185,7 +185,12 @@ def test_id_not_found(self, room_api):
185185
186186class TestCreatePeer :
187187 def _assert_peer_created (
188- self , room_api , webrtc_peer , room_id , server_metadata = None
188+ self ,
189+ room_api ,
190+ webrtc_peer ,
191+ room_id ,
192+ server_metadata = None ,
193+ subscribe = None ,
189194 ):
190195 server_metadata = server_metadata or {}
191196
@@ -195,25 +200,26 @@ def _assert_peer_created(
195200 status = PeerStatus ("disconnected" ),
196201 tracks = [],
197202 metadata = PeerMetadata .from_dict ({"peer" : {}, "server" : server_metadata }),
198- subscribe = None ,
203+ subscribe = subscribe ,
199204 )
200205
201206 room = room_api .get_room (room_id )
202207 assert peer in room .peers
203208
204209 def test_with_specified_options (self , room_api : FishjamClient ):
210+ subscribe = SubscribeOptions (
211+ audio_format = SubscribeOptionsAudioFormat .PCM16 ,
212+ audio_sample_rate = SubscribeOptionsAudioSampleRate .VALUE_16000 ,
213+ )
205214 options = PeerOptions (
206215 enable_simulcast = True ,
207- subscribe = SubscribeOptions (
208- audio_format = SubscribeOptionsAudioFormat .PCM16 ,
209- audio_sample_rate = SubscribeOptionsAudioSampleRate .VALUE_16000 ,
210- ),
216+ subscribe = subscribe ,
211217 )
212218
213219 room = room_api .create_room ()
214220 peer , _token = room_api .create_peer (room .id , options = options )
215221
216- self ._assert_peer_created (room_api , peer , room .id )
222+ self ._assert_peer_created (room_api , peer , room .id , subscribe = subscribe )
217223
218224 def test_with_metadata (self , room_api : FishjamClient ):
219225 options = PeerOptions (metadata = {"is_test" : True })
0 commit comments