#NEWLINE# def assert_fails_if_error( self , lib_mock , func ) : #NEWLINE# #INDENT# lib_mock . sp_search_error . return_value = spotify . ErrorType . BAD_API_VERSION #NEWLINE# sp_search = spotify . ffi . cast ( 'sp_search *' , 42 ) #NEWLINE# search = spotify . Search ( lib_mock . session , sp_search = sp_search ) #NEWLINE# with self . assertRaises ( spotify . Error ) : #NEWLINE# #INDENT# func ( search )