Skip to content

Commit ba62ca2

Browse files
author
Ammar Dodin
committed
🐛 fix add_custom_word() to use PUT
1 parent 242929b commit ba62ca2

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

test/test_speech_to_text_v1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def test_custom_words():
154154
words_url = 'https://stream.watsonplatform.net/speech-to-text/api/v1/customizations/{0}/words'
155155
word_url = 'https://stream.watsonplatform.net/speech-to-text/api/v1/customizations/{0}/words/{1}'
156156

157-
responses.add(responses.POST, word_url.format('custid', 'IEEE'),
157+
responses.add(responses.PUT, word_url.format('custid', 'IEEE'),
158158
body='{"get response": "yep"}',
159159
status=200,
160160
content_type='application/json')

watson_developer_cloud/speech_to_text_v1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def add_custom_word(self, customization_id, custom_word):
178178

179179
custom_word_fragment = {'sounds_like': custom_word.sounds_like,
180180
'display_as': custom_word.display_as}
181-
return self.request(method='POST',
181+
return self.request(method='PUT',
182182
url=url.format(customization_id,
183183
custom_word.word),
184184
data=json.dumps(custom_word_fragment),

0 commit comments

Comments
 (0)