Skip to content

Commit b1c6bdb

Browse files
committed
test(speech to text): adjust speech to text tests for add_word patch
1 parent 2b407e0 commit b1c6bdb

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

test/integration/test_speech_to_text_v1.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,5 +231,23 @@ def test_invalid_auth_with_websocket
231231
thr.join
232232
assert(atomic_boolean.true?)
233233
end
234+
235+
def test_add_word
236+
model = @service.create_language_model(
237+
name: "integration_test_model",
238+
base_model_name: "en-US_BroadbandModel"
239+
).result
240+
customization_id = model["customization_id"]
241+
service_response = @service.add_word(
242+
customization_id: customization_id,
243+
word_name: "IEEE",
244+
sounds_like: ["i triple e"],
245+
display_as: "IEEE"
246+
)
247+
assert_nil(service_response)
248+
@service.delete_language_model(
249+
customization_id: customization_id
250+
)
251+
end
234252
end
235253
end

test/unit/test_speech_to_text_v1.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ def test_custom_words
408408
)
409409
stub_request(:put, "https://stream.watsonplatform.net/speech-to-text/api/v1/customizations/custid/words/IEEE")
410410
.with(
411-
body: "{\"sounds_like\":[\"i triple e\"],\"display_as\":\"IEEE\"}",
411+
body: "{\"word\":\"IEEE\",\"sounds_like\":[\"i triple e\"],\"display_as\":\"IEEE\"}",
412412
headers: {
413413
"Accept" => "application/json",
414414
"Authorization" => "Basic dXNlcm5hbWU6cGFzc3dvcmQ=",

0 commit comments

Comments
 (0)