#NEWLINE# @ mock . patch ( 'main.modules' ) #NEWLINE# @ mock . patch ( 'urllib2.urlopen' ) #NEWLINE# def test_get_backend( url_open_mock , modules_mock , app ) : #NEWLINE# #INDENT# url_read_mock = mock . Mock ( read = mock . Mock ( return_value = 'hello world' ) ) #NEWLINE# url_open_mock . return_value = url_read_mock #NEWLINE# response = app . get ( '/access_backend' ) #NEWLINE# assert ( response . status_int == 200 ) #NEWLINE# assert ( response . body == 'Got response hello world' )