Skip to content

Commit b3ce8a0

Browse files
committed
listTransferMethods not handling response as a list
1 parent 68ded29 commit b3ce8a0

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

hyperwallet/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3144,7 +3144,7 @@ def listTransferMethods(self,
31443144
params
31453145
)
31463146

3147-
return TransferMethod(response)
3147+
return [TransferMethod(x) for x in response.get('data', [])]
31483148

31493149
'''
31503150

hyperwallet/tests/test_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2966,15 +2966,15 @@ def test_list_transfer_methods_params_valid(self, mock_get):
29662966
mock_get.return_value = self.data
29672967
response = self.api.listTransferMethods('token', options)
29682968

2969-
self.assertTrue(response.token, self.data.get('token'))
2969+
self.assertTrue(response[0].token, self.data.get('token'))
29702970

29712971
@mock.patch('hyperwallet.utils.ApiClient._makeRequest')
29722972
def test_list_transfer_methods_success(self, mock_get):
29732973

29742974
mock_get.return_value = self.data
29752975
response = self.api.listTransferMethods('token')
29762976

2977-
self.assertTrue(response.token, self.data.get('token'))
2977+
self.assertTrue(response[0].token, self.data.get('token'))
29782978

29792979

29802980
if __name__ == '__main__':

0 commit comments

Comments
 (0)