@@ -207,7 +207,7 @@ def logged_on_user() -> Dict[str, Any]:
207207
208208
209209@pytest .fixture
210- def general_stream () -> Dict [ str , Any ] :
210+ def general_stream () -> Subscription :
211211 return {
212212 "name" : "Some general stream" ,
213213 "date_created" : 1472091253 ,
@@ -220,21 +220,25 @@ def general_stream() -> Dict[str, Any]:
220220 "audible_notifications" : False ,
221221 "description" : "General Stream" ,
222222 "rendered_description" : "General Stream" ,
223- "is_old_stream" : True ,
224223 "desktop_notifications" : False ,
225224 "stream_weekly_traffic" : 0 ,
226225 "push_notifications" : False ,
227226 "email_address" :
"[email protected] " ,
228227 "message_retention_days" : 10 ,
229228 "subscribers" : [1001 , 11 , 12 ],
230229 "history_public_to_subscribers" : True ,
230+ "is_announcement_only" : False ,
231+ "stream_post_policy" : 0 ,
232+ "first_message_id" : 1 ,
233+ "email_notifications" : False ,
234+ "wildcard_mentions_notify" : False ,
231235 }
232236
233237
234238# This is a private stream;
235239# only description/stream_id/invite_only/name/color vary from above
236240@pytest .fixture
237- def secret_stream () -> Dict [ str , Any ] :
241+ def secret_stream () -> Subscription :
238242 return {
239243 "description" : "Some private stream" ,
240244 "stream_id" : 99 ,
@@ -248,19 +252,23 @@ def secret_stream() -> Dict[str, Any]:
248252 "is_muted" : False ,
249253 "is_web_public" : False ,
250254 "audible_notifications" : False ,
251- "is_old_stream" : True ,
252255 "desktop_notifications" : False ,
253256 "stream_weekly_traffic" : 0 ,
254257 "message_retention_days" : - 1 ,
255258 "push_notifications" : False ,
256259 "subscribers" : [1001 , 11 ],
257260 "history_public_to_subscribers" : False ,
261+ "is_announcement_only" : False ,
262+ "stream_post_policy" : 0 ,
263+ "first_message_id" : 1 ,
264+ "email_notifications" : False ,
265+ "wildcard_mentions_notify" : False ,
258266 }
259267
260268
261269# Like public stream but with is_web_public=True
262270@pytest .fixture
263- def web_public_stream () -> Dict [ str , Any ] :
271+ def web_public_stream () -> Subscription :
264272 return {
265273 "description" : "Some web public stream" ,
266274 "stream_id" : 999 ,
@@ -273,24 +281,28 @@ def web_public_stream() -> Dict[str, Any]:
273281 "color" : "#ddd" , # Color in '#xxx' format
274282 "is_muted" : False ,
275283 "audible_notifications" : False ,
276- "is_old_stream" : True ,
277284 "desktop_notifications" : False ,
278285 "stream_weekly_traffic" : 0 ,
279286 "message_retention_days" : - 1 ,
280287 "push_notifications" : False ,
281288 "subscribers" : [1001 , 11 ],
282289 "history_public_to_subscribers" : False ,
283290 "is_web_public" : True ,
291+ "is_announcement_only" : False ,
292+ "stream_post_policy" : 0 ,
293+ "first_message_id" : 1 ,
294+ "email_notifications" : False ,
295+ "wildcard_mentions_notify" : False ,
284296 }
285297
286298
287299@pytest .fixture
288300def get_stream_from_id_fixture (
289301 stream_id : int ,
290- stream_dict : Dict [int , Any ],
302+ stream_dict : Dict [int , Subscription ],
291303 unsubscribed_streams_fixture : Dict [int , Subscription ],
292304 never_subscribed_streams_fixture : Dict [int , Stream ],
293- ) -> Union [Subscription , Stream , Any ]:
305+ ) -> Union [Subscription , Stream ]:
294306 if stream_id in stream_dict :
295307 return stream_dict [stream_id ]
296308 elif stream_id in unsubscribed_streams_fixture :
@@ -301,10 +313,10 @@ def get_stream_from_id_fixture(
301313
302314@pytest .fixture
303315def streams_fixture (
304- general_stream : Dict [ str , Any ] ,
305- secret_stream : Dict [ str , Any ] ,
306- web_public_stream : Dict [ str , Any ] ,
307- ) -> List [Dict [ str , Any ] ]:
316+ general_stream : Subscription ,
317+ secret_stream : Subscription ,
318+ web_public_stream : Subscription ,
319+ ) -> List [Subscription ]:
308320 streams = [general_stream , secret_stream , web_public_stream ]
309321 for i in range (1 , 3 ):
310322 streams .append (
@@ -319,7 +331,6 @@ def streams_fixture(
319331 "audible_notifications" : False ,
320332 "description" : f"A description of stream { i } " ,
321333 "rendered_description" : f"A description of stream { i } " ,
322- "is_old_stream" : True ,
323334 "desktop_notifications" : False ,
324335 "stream_weekly_traffic" : 0 ,
325336 "push_notifications" : False ,
@@ -328,6 +339,11 @@ def streams_fixture(
328339 "subscribers" : [1001 , 11 , 12 ],
329340 "history_public_to_subscribers" : True ,
330341 "is_web_public" : False ,
342+ "is_announcement_only" : False ,
343+ "stream_post_policy" : 0 ,
344+ "first_message_id" : 1 ,
345+ "email_notifications" : False ,
346+ "wildcard_mentions_notify" : False ,
331347 }
332348 )
333349 return deepcopy (streams )
@@ -648,7 +664,7 @@ def mentioned_messages_combination(request: Any) -> Tuple[Set[int], Set[int]]:
648664def initial_data (
649665 logged_on_user : Dict [str , Any ],
650666 users_fixture : List [Dict [str , Any ]],
651- streams_fixture : List [Dict [str , Any ]],
667+ streams_fixture : List [Dict [str , Subscription ]],
652668 realm_emojis : Dict [str , Dict [str , Any ]],
653669) -> Dict [str , Any ]:
654670 """
@@ -1262,7 +1278,7 @@ def never_subscribed_streams_fixture() -> Dict[int, Stream]:
12621278
12631279
12641280@pytest .fixture
1265- def stream_dict (streams_fixture : List [Dict [ str , Any ]] ) -> Dict [int , Any ]:
1281+ def stream_dict (streams_fixture : List [Subscription ] ) -> Dict [int , Subscription ]:
12661282 return {stream ["stream_id" ]: stream for stream in streams_fixture }
12671283
12681284
0 commit comments