@@ -410,17 +410,26 @@ def test_init(self, mocker, stream_view):
410
410
stream_view , 'SEARCH_STREAMS' , stream_view .update_streams )
411
411
412
412
@pytest .mark .parametrize ('new_text, expected_log' , [
413
- ('f' , ['FOO' , 'foo' , 'fan' ]),
414
- ('foo' , ['FOO' , 'foo' ]),
415
- ('FOO' , ['FOO' , 'foo' ]),
413
+ ('f' , ['FOO' , 'FOOBAR' , 'foo' , 'fan' ]),
414
+ ('a' , ['FOOBAR' , 'fan' , 'bar' ]),
415
+ ('bar' , ['FOOBAR' , 'bar' ]),
416
+ ('foo' , ['FOO' , 'FOOBAR' , 'foo' ]),
417
+ ('FOO' , ['FOO' , 'FOOBAR' , 'foo' ]),
418
+ ('test' , ['test here' ]),
419
+ ('here' , ['test here' ]),
416
420
])
417
421
def test_update_streams (self , mocker , stream_view , new_text , expected_log ):
422
+ stream_names = [
423
+ 'FOO' , 'FOOBAR' , 'foo' , 'fan' ,
424
+ 'boo' , 'BOO' , 'bar' , 'test here' ,
425
+ ]
418
426
self .view .controller .editor_mode = True
419
427
new_text = new_text
420
428
search_box = "SEARCH_BOX"
421
429
stream_view .streams_btn_list = [
422
- mocker .Mock (stream_name = stream_name ) for stream_name in [
423
- 'FOO' , 'foo' , 'fan' , 'boo' , 'BOO' ]]
430
+ mocker .Mock (stream_name = stream_name )
431
+ for stream_name in stream_names
432
+ ]
424
433
stream_view .update_streams (search_box , new_text )
425
434
assert [stream .stream_name for stream in stream_view .log
426
435
] == expected_log
@@ -521,17 +530,26 @@ def test_init(self, mocker, topic_view):
521
530
topic_view .topic_search_box ])
522
531
523
532
@pytest .mark .parametrize ('new_text, expected_log' , [
524
- ('f' , ['FOO' , 'foo' , 'fan' ]),
525
- ('foo' , ['FOO' , 'foo' ]),
526
- ('FOO' , ['FOO' , 'foo' ]),
533
+ ('f' , ['FOO' , 'FOOBAR' , 'foo' , 'fan' ]),
534
+ ('a' , ['FOOBAR' , 'fan' , 'bar' ]),
535
+ ('bar' , ['FOOBAR' , 'bar' ]),
536
+ ('foo' , ['FOO' , 'FOOBAR' , 'foo' ]),
537
+ ('FOO' , ['FOO' , 'FOOBAR' , 'foo' ]),
538
+ ('(no' , ['(no topic)' ]),
539
+ ('topic' , ['(no topic)' ]),
527
540
])
528
541
def test_update_topics (self , mocker , topic_view , new_text , expected_log ):
542
+ topic_names = [
543
+ 'FOO' , 'FOOBAR' , 'foo' , 'fan' ,
544
+ 'boo' , 'BOO' , 'bar' , '(no topic)' ,
545
+ ]
529
546
self .view .controller .editor_mode = True
530
547
new_text = new_text
531
548
search_box = "SEARCH_BOX"
532
549
topic_view .topics_btn_list = [
533
- mocker .Mock (topic_name = topic_name ) for topic_name in [
534
- 'FOO' , 'foo' , 'fan' , 'boo' , 'BOO' ]]
550
+ mocker .Mock (topic_name = topic_name )
551
+ for topic_name in topic_names
552
+ ]
535
553
topic_view .update_topics (search_box , new_text )
536
554
assert [topic .topic_name for topic in topic_view .log
537
555
] == expected_log
0 commit comments