#NEWLINE# def test_duration( self , lib_mock ) : #NEWLINE# #INDENT# lib_mock . sp_track_error . return_value = spotify . ErrorType . OK #NEWLINE# lib_mock . sp_track_duration . return_value = 60000 #NEWLINE# sp_track = spotify . ffi . cast ( 'sp_track *' , 42 ) #NEWLINE# track = spotify . Track ( lib_mock . session , sp_track = sp_track ) #NEWLINE# result = track . duration #NEWLINE# lib_mock . sp_track_duration . assert_called_with ( sp_track ) #NEWLINE# self . assertEqual ( result , 60000 )