#NEWLINE# @ mock . patch ( 'spotify.track.lib' , spec = spotify . lib ) #NEWLINE# def test_player_prefetch_fail_raises_error( self , track_lib_mock , session_lib_mock , lib_mock ) : #NEWLINE# #INDENT# lib_mock . sp_session_player_prefetch . return_value = spotify . ErrorType . NO_CACHE #NEWLINE# session = tests . create_real_session ( session_lib_mock ) #NEWLINE# sp_track = spotify . ffi . cast ( 'sp_track *' , 42 ) #NEWLINE# track = spotify . Track ( session , sp_track = sp_track ) #NEWLINE# with self . assertRaises ( spotify . Error ) : #NEWLINE# #INDENT# session . player . prefetch ( self )