@@ -134,10 +134,9 @@ def test_narrow_to_stream(
134
134
controller .model .narrow = []
135
135
controller .model .index = index_stream
136
136
controller .view .message_view = mocker .patch ("urwid.ListBox" )
137
- controller .model .stream_dict = {
138
- stream_id : general_stream ,
139
- }
140
- controller .model .stream_dict [stream_id ]["name" ] = stream_name
137
+ mocker .patch (MODEL + ".stream_name_from_id" , return_value = stream_name )
138
+ mocker .patch (MODEL + ".stream_id_from_name" , return_value = stream_id )
139
+ mocker .patch (MODEL + ".is_user_subscribed_to_stream" , return_value = True )
141
140
controller .model .muted_streams = set ()
142
141
mocker .patch (MODEL + ".is_muted_topic" , return_value = False )
143
142
@@ -186,10 +185,9 @@ def test_narrow_to_topic(
186
185
controller .model .index = index_multiple_topic_msg
187
186
controller .model .stream_id = initial_stream_id
188
187
controller .view .message_view = mocker .patch ("urwid.ListBox" )
189
- controller .model .stream_dict = {
190
- stream_id : general_stream ,
191
- }
192
- controller .model .stream_dict [stream_id ]["name" ] = stream_name
188
+ mocker .patch (MODEL + ".stream_name_from_id" , return_value = stream_name )
189
+ mocker .patch (MODEL + ".stream_id_from_name" , return_value = stream_id )
190
+ mocker .patch (MODEL + ".is_user_subscribed_to_stream" , return_value = True )
193
191
controller .model .muted_streams = set ()
194
192
mocker .patch (MODEL + ".is_muted_topic" , return_value = False )
195
193
@@ -263,9 +261,7 @@ def test_narrow_to_all_messages(
263
261
controller .view .message_view = mocker .patch ("urwid.ListBox" )
264
262
controller .model .user_email = "some@email"
265
263
controller .model .user_id = 1
266
- controller .model .stream_dict = {
267
- stream_id : general_stream ,
268
- }
264
+ mocker .patch (MODEL + ".is_user_subscribed_to_stream" , return_value = True )
269
265
controller .model .muted_streams = set ()
270
266
mocker .patch (MODEL + ".is_muted_topic" , return_value = False )
271
267
@@ -315,9 +311,7 @@ def test_narrow_to_all_starred(
315
311
# FIXME: Expand upon is_muted_topic().
316
312
mocker .patch (MODEL + ".is_muted_topic" , return_value = False )
317
313
controller .model .user_email = "some@email"
318
- controller .model .stream_dict = {
319
- stream_id : general_stream ,
320
- }
314
+ mocker .patch (MODEL + ".is_user_subscribed_to_stream" , return_value = True )
321
315
controller .view .message_view = mocker .patch ("urwid.ListBox" )
322
316
323
317
controller .narrow_to_all_starred () # FIXME: Add id narrowing test
@@ -345,9 +339,7 @@ def test_narrow_to_all_mentions(
345
339
mocker .patch (MODEL + ".is_muted_topic" , return_value = False )
346
340
controller .model .user_email = "some@email"
347
341
controller .model .user_id = 1
348
- controller .model .stream_dict = {
349
- stream_id : general_stream ,
350
- }
342
+ mocker .patch (MODEL + ".is_user_subscribed_to_stream" , return_value = True )
351
343
controller .view .message_view = mocker .patch ("urwid.ListBox" )
352
344
353
345
controller .narrow_to_all_mentions () # FIXME: Add id narrowing test
0 commit comments