#NEWLINE# def test_subreddit_search( subreddit_page , terminal ) : #NEWLINE# #INDENT# with mock . patch . object ( terminal , 'prompt_input' ) : #NEWLINE# #INDENT# terminal . prompt_input . return_value = 'search term' #NEWLINE# subreddit_page . controller . trigger ( 'f' ) #NEWLINE# assert ( subreddit_page . content . name == '/r/python' ) #NEWLINE# assert subreddit_page . prompt_input . called #NEWLINE# assert ( not terminal . loader . exception ) #NEWLINE# #UNINDENT# with mock . patch . object ( terminal , 'prompt_input' ) : #NEWLINE# #INDENT# terminal . prompt_input . return_value = None #NEWLINE# subreddit_page . controller . trigger ( 'f' ) #NEWLINE# assert ( not terminal . loader . exception )