2323from system_test_utils import unique_resource_id
2424from retry import RetryErrors
2525
26+ AUDIO_FILE = os .path .join (os .path .dirname (__file__ ), 'data' , 'hello.wav' )
27+
2628
2729class Config (object ):
2830 """Run-time configuration to be modified at set-up.
@@ -32,8 +34,6 @@ class Config(object):
3234 """
3335 CLIENT = None
3436 TEST_BUCKET = None
35- AUDIO_FILE = os .path .join (os .path .dirname (__file__ ), 'data' , 'hello.wav' )
36- ASSERT_TEXT = 'thank you for using Google Cloud platform'
3737
3838
3939def setUpModule ():
@@ -56,6 +56,8 @@ def tearDownModule():
5656
5757
5858class TestSpeechClient (unittest .TestCase ):
59+ ASSERT_TEXT = 'thank you for using Google Cloud platform'
60+
5961 def setUp (self ):
6062 self .to_delete_by_case = []
6163
@@ -81,7 +83,7 @@ def _check_best_results(self, results):
8183 top_result = results [0 ]
8284 self .assertIsInstance (top_result , Transcript )
8385 self .assertEqual (top_result .transcript ,
84- 'hello ' + Config .ASSERT_TEXT )
86+ 'hello ' + self .ASSERT_TEXT )
8587 self .assertGreater (top_result .confidence , 0.90 )
8688
8789 def test_sync_recognize_local_file (self ):
@@ -92,7 +94,7 @@ def test_sync_recognize_local_file(self):
9294 self .assertEqual (len (results ), 2 )
9395 self ._check_best_results (results )
9496 self .assertIsInstance (second_alternative , Transcript )
95- self .assertEqual (second_alternative .transcript , Config .ASSERT_TEXT )
97+ self .assertEqual (second_alternative .transcript , self .ASSERT_TEXT )
9698 self .assertEqual (second_alternative .confidence , 0.0 )
9799
98100 def test_sync_recognize_gcs_file (self ):
0 commit comments