@@ -360,7 +360,15 @@ def test_custom_corpora
360360 service_response = service . add_corpus (
361361 customization_id : "customid" ,
362362 corpus_name : "corpus" ,
363- corpus_file : corpus_file
363+ corpus_file : corpus_file ,
364+ corpus_filename : "corpus-short-1.txt"
365+ )
366+ assert_nil ( service_response )
367+
368+ service_response = service . add_corpus (
369+ customization_id : "customid" ,
370+ corpus_name : "corpus" ,
371+ corpus_file : "corpus_file"
364372 )
365373 assert_nil ( service_response )
366374
@@ -693,4 +701,55 @@ def test_recognize_async
693701 output = future . value . body
694702 assert_equal ( recognize_response [ "results" ] [ 0 ] [ "alternatives" ] [ 0 ] [ "transcript" ] , output [ "results" ] [ 0 ] [ "alternatives" ] [ 0 ] [ "transcript" ] )
695703 end
704+
705+ def test_reset_language_model
706+ service = WatsonAPIs ::SpeechToTextV1 . new (
707+ username : "username" ,
708+ password : "password"
709+ )
710+ stub_request ( :post , "https://stream.watsonplatform.net/speech-to-text/api/v1/customizations/customization_id/reset" )
711+ . with (
712+ headers : {
713+ "Accept" => "application/json" ,
714+ "Authorization" => "Basic dXNlcm5hbWU6cGFzc3dvcmQ=" ,
715+ "Host" => "stream.watsonplatform.net"
716+ }
717+ ) . to_return ( status : 200 , body : "" , headers : { } )
718+ service_response = service . reset_language_model ( customization_id : "customization_id" )
719+ assert_nil ( service_response )
720+ end
721+
722+ def test_upgrade_language_model
723+ service = WatsonAPIs ::SpeechToTextV1 . new (
724+ username : "username" ,
725+ password : "password"
726+ )
727+ stub_request ( :post , "https://stream.watsonplatform.net/speech-to-text/api/v1/customizations/customization_id/upgrade_model" )
728+ . with (
729+ headers : {
730+ "Accept" => "application/json" ,
731+ "Authorization" => "Basic dXNlcm5hbWU6cGFzc3dvcmQ=" ,
732+ "Host" => "stream.watsonplatform.net"
733+ }
734+ ) . to_return ( status : 200 , body : "" , headers : { } )
735+ service_response = service . upgrade_language_model ( customization_id : "customization_id" )
736+ assert_nil ( service_response )
737+ end
738+
739+ def test_upgrade_acoustic_model
740+ service = WatsonAPIs ::SpeechToTextV1 . new (
741+ username : "username" ,
742+ password : "password"
743+ )
744+ stub_request ( :post , "https://stream.watsonplatform.net/speech-to-text/api/v1/acoustic_customizations/customization_id/upgrade_model" )
745+ . with (
746+ headers : {
747+ "Accept" => "application/json" ,
748+ "Authorization" => "Basic dXNlcm5hbWU6cGFzc3dvcmQ=" ,
749+ "Host" => "stream.watsonplatform.net"
750+ }
751+ ) . to_return ( status : 200 , body : "" , headers : { } )
752+ service_response = service . upgrade_acoustic_model ( customization_id : "customization_id" )
753+ assert_nil ( service_response )
754+ end
696755end
0 commit comments