#NEWLINE# @ mock . patch ( 'spotify.Link' , spec = spotify . Link ) #NEWLINE# def test_link_with_offset( self , link_mock , lib_mock ) : #NEWLINE# #INDENT# sp_track = spotify . ffi . cast ( 'sp_track *' , 42 ) #NEWLINE# track = spotify . Track ( self . session , sp_track = sp_track ) #NEWLINE# sp_link = spotify . ffi . cast ( 'sp_link *' , 43 ) #NEWLINE# lib_mock . sp_link_create_from_track . return_value = sp_link #NEWLINE# link_mock . return_value = mock . sentinel . link #NEWLINE# result = track . link_with_offset ( 90 ) #NEWLINE# lib_mock . sp_link_create_from_track . asssert_called_once_with ( self , 90 ) #NEWLINE# link_mock . assert_called_once_with ( self . session , sp_link = sp_link , add_ref = False ) #NEWLINE# self . assertEqual ( result , mock . sentinel . link )