#NEWLINE# @ mock . patch . object ( trovebox . Trovebox , 'get' ) #NEWLINE# def test_albums_list( self , mock_get ) : #NEWLINE# #INDENT# 'Check that the album list is returned correctly' #NEWLINE# mock_get . return_value = self . _return_value ( self . test_albums_dict ) #NEWLINE# result = self . client . albums . list ( foo = 'bar' ) #NEWLINE# mock_get . assert_called_with ( '/albums/list.json' , foo = 'bar' ) #NEWLINE# self . assertEqual ( len ( result ) , 2 ) #NEWLINE# self . assertEqual ( result [ 0 ] . id , '1' ) #NEWLINE# self . assertEqual ( result [ 0 ] . name , 'Album 1' ) #NEWLINE# self . assertEqual ( result [ 1 ] . id , '2' ) #NEWLINE# self . assertEqual ( result [ 1 ] . name , 'Album 2' )