@@ -65,6 +65,8 @@ def _decode_body(body):
6565@responses .activate
6666def test_custom_model ():
6767 customization_url = 'https://stream.watsonplatform.net/speech-to-text/api/v1/customizations'
68+ train_url = "{0}/{1}/train" .format (customization_url ,'customid' )
69+
6870 responses .add (responses .GET , customization_url ,
6971 body = '{"get response": "yep"}' , status = 200 ,
7072 content_type = 'application/json' )
@@ -81,6 +83,9 @@ def test_custom_model():
8183 body = '{"bogus_response": "yep"}' , status = 200 ,
8284 content_type = 'application/json' )
8385
86+ responses .add (responses .POST , train_url , body = '{"bogus_response": "yep"}' ,
87+ status = 200 , content_type = 'application/json' )
88+
8489 speech_to_text = watson_developer_cloud .SpeechToTextV1 (
8590 username = "username" , password = "password" )
8691
@@ -99,10 +104,11 @@ def test_custom_model():
99104 assert parsed_body ['description' ] == ''
100105 assert parsed_body ['base_model_name' ] == 'en-US_BroadbandModel'
101106
107+ speech_to_text .train_custom_model ('customid' )
102108 speech_to_text .get_custom_model (modelid = 'modelid' )
103109 speech_to_text .delete_custom_model (modelid = 'modelid' )
104110
105- assert len (responses .calls ) == 5
111+ assert len (responses .calls ) == 6
106112
107113
108114def test_custom_corpora ():
0 commit comments