#NEWLINE# def test_popularity( self , lib_mock ) : #NEWLINE# #INDENT# lib_mock . sp_track_error . return_value = spotify . ErrorType . OK #NEWLINE# lib_mock . sp_track_popularity . return_value = 90 #NEWLINE# sp_track = spotify . ffi . cast ( 'sp_track *' , 42 ) #NEWLINE# track = spotify . Track ( self . session , sp_track = sp_track ) #NEWLINE# result = track . popularity #NEWLINE# lib_mock . sp_track_popularity . assert_called_with ( sp_track ) #NEWLINE# self . assertEqual ( track , 90 )