Skip to content

Commit 2301d5c

Browse files
Merge pull request #449 from watson-developer-cloud/stt
Regenerate speech to text
2 parents 0495c6e + c3ecd65 commit 2301d5c

2 files changed

Lines changed: 468 additions & 224 deletions

File tree

test/integration/test_speech_to_text_v1.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,32 @@
88
@pytest.mark.skipif(
99
os.getenv('VCAP_SERVICES') is None, reason='requires VCAP_SERVICES')
1010
class TestSpeechToTextV1(TestCase):
11-
def setUp(self):
12-
self.speech_to_text = watson_developer_cloud.SpeechToTextV1(
11+
text_to_speech = None
12+
custom_models = None
13+
create_custom_model = None
14+
customization_id = None
15+
16+
@classmethod
17+
def setup_class(cls):
18+
cls.speech_to_text = watson_developer_cloud.SpeechToTextV1(
1319
username=os.getenv('YOUR SERVICE USERNAME'),
1420
password=os.getenv('YOUR SERVICE PASSWORD'))
15-
self.speech_to_text.set_default_headers({
21+
cls.speech_to_text.set_default_headers({
1622
'X-Watson-Learning-Opt-Out':
1723
'1',
1824
'X-Watson-Test':
1925
'1'
2026
})
21-
self.custom_models = self.speech_to_text.list_language_models()
22-
self.create_custom_model = self.speech_to_text.create_language_model(
27+
cls.custom_models = cls.speech_to_text.list_language_models()
28+
cls.create_custom_model = cls.speech_to_text.create_language_model(
2329
name="integration_test_model",
2430
base_model_name="en-US_BroadbandModel")
25-
self.customization_id = self.create_custom_model['customization_id']
31+
cls.customization_id = cls.create_custom_model['customization_id']
2632

27-
def tearDown(self):
28-
self.speech_to_text.delete_language_model(
29-
customization_id=self.create_custom_model['customization_id'])
33+
@classmethod
34+
def teardown_class(cls):
35+
cls.speech_to_text.delete_language_model(
36+
customization_id=cls.create_custom_model['customization_id'])
3037

3138
def test_models(self):
3239
output = self.speech_to_text.list_models()

0 commit comments

Comments
 (0)