#NEWLINE# @ contextmanager #NEWLINE# def _mocked_get( self , url , status_code ) : #NEWLINE# #INDENT# with patch ( 'cheddar.index.remote.get' ) as mock_get : #NEWLINE# #INDENT# mock_get . return_value . status_code = status_code #NEWLINE# mock_get . return_value . history = [ ] #NEWLINE# mock_get . return_value . headers = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# ( yield mock_get ) #NEWLINE# mock_get . assert_called_with ( url , timeout = status_code . app . config [ 'GET_TIMEOUT' ] )