@@ -37,6 +37,14 @@ async def test_play(self, audio_out: MockAudioOut):
3737 assert audio_out .last_audio_data == audio_data
3838 assert audio_out .last_audio_info == audio_info
3939
40+ @pytest .mark .asyncio
41+ async def test_play_without_audio_info (self , audio_out : MockAudioOut ):
42+ audio_data = b"test_audio_data"
43+ await audio_out .play (audio_data )
44+ assert audio_out .play_called
45+ assert audio_out .last_audio_data == audio_data
46+ assert audio_out .last_audio_info is None
47+
4048 @pytest .mark .asyncio
4149 async def test_get_properties (self , audio_out : MockAudioOut ):
4250 properties = await audio_out .get_properties ()
@@ -72,6 +80,25 @@ async def test_play(self, audio_out: MockAudioOut, service: AudioOutRPCService):
7280 assert audio_out .last_audio_data == audio_data
7381 assert audio_out .last_audio_info == audio_info
7482
83+ @pytest .mark .asyncio
84+ async def test_play_without_audio_info (self , audio_out : MockAudioOut , service : AudioOutRPCService ):
85+ audio_data = b"test_audio_data"
86+
87+ async with ChannelFor ([service ]) as channel :
88+ client = AudioOutServiceStub (channel )
89+ request = PlayRequest (
90+ name = audio_out .name ,
91+ audio_data = audio_data ,
92+ audio_info = None ,
93+ extra = dict_to_struct ({}),
94+ )
95+
96+ await client .Play (request )
97+
98+ assert audio_out .play_called
99+ assert audio_out .last_audio_data == audio_data
100+ assert audio_out .last_audio_info is None
101+
75102 @pytest .mark .asyncio
76103 async def test_get_properties (self , audio_out : MockAudioOut , service : AudioOutRPCService ):
77104 async with ChannelFor ([service ]) as channel :
@@ -122,6 +149,18 @@ async def test_play(self, audio_out: MockAudioOut, service: AudioOutRPCService):
122149 assert audio_out .last_audio_data == audio_data
123150 assert audio_out .last_audio_info == audio_info
124151
152+ @pytest .mark .asyncio
153+ async def test_play_without_audio_info (self , audio_out : MockAudioOut , service : AudioOutRPCService ):
154+ async with ChannelFor ([service ]) as channel :
155+ client = AudioOutClient (audio_out .name , channel )
156+ audio_data = b"test_audio_data"
157+
158+ await client .play (audio_data )
159+
160+ assert audio_out .play_called
161+ assert audio_out .last_audio_data == audio_data
162+ assert audio_out .last_audio_info is None
163+
125164 @pytest .mark .asyncio
126165 async def test_get_properties (self , audio_out : MockAudioOut ,service : AudioOutRPCService ):
127166 async with ChannelFor ([service ]) as channel :
0 commit comments