From 795054fbac53cad27e7526582534e5b09a757213 Mon Sep 17 00:00:00 2001 From: Thomas Schultz Date: Tue, 14 Feb 2017 10:59:12 -0500 Subject: [PATCH] Fix build failing with float precision mismatch (#3002) --- .../unit_tests/test_client.py | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-speech/unit_tests/test_client.py b/packages/google-cloud-speech/unit_tests/test_client.py index 2cf5b8e3282b..b8a87e8b0b55 100644 --- a/packages/google-cloud-speech/unit_tests/test_client.py +++ b/packages/google-cloud-speech/unit_tests/test_client.py @@ -297,10 +297,10 @@ def test_sync_recognize_with_gax(self): alternatives = [{ 'transcript': 'testing 1 2 3', - 'confidence': 0.9224355, + 'confidence': 0.740234375, }, { 'transcript': 'testing 4 5 6', - 'confidence': 0.0123456, + 'confidence': 0.6396484375, }] result = _make_result(alternatives) @@ -500,19 +500,19 @@ def test_stream_recognize_interim_results(self): alternatives = [{ 'transcript': 'testing streaming 1 2 3', - 'confidence': 0.9224355, + 'confidence': 0.5888671875, }, { 'transcript': 'testing streaming 4 5 6', - 'confidence': 0.0123456, + 'confidence': 0.28125, }] first_response = _make_streaming_response( - _make_streaming_result([], is_final=False, stability=0.122435)) + _make_streaming_result([], is_final=False, stability=0.314453125)) second_response = _make_streaming_response( _make_streaming_result(alternatives, is_final=False, - stability=0.1432343)) + stability=0.28125)) last_response = _make_streaming_response( _make_streaming_result(alternatives, is_final=True, - stability=0.9834534)) + stability=0.4375)) responses = [first_response, second_response, last_response] channel_args = [] @@ -542,8 +542,8 @@ def speech_api(channel=None): self.assertIsInstance(results[0], StreamingSpeechResult) self.assertEqual(results[0].alternatives, []) self.assertFalse(results[0].is_final) - self.assertEqual(results[0].stability, 0.122435) - self.assertEqual(results[1].stability, 0.1432343) + self.assertEqual(results[0].stability, 0.314453125) + self.assertEqual(results[1].stability, 0.28125) self.assertFalse(results[1].is_final) self.assertEqual(results[1].transcript, results[1].alternatives[0].transcript, @@ -556,7 +556,7 @@ def speech_api(channel=None): self.assertEqual(results[1].alternatives[1].confidence, alternatives[1]['confidence']) self.assertTrue(results[2].is_final) - self.assertEqual(results[2].stability, 0.9834534) + self.assertEqual(results[2].stability, 0.4375) self.assertEqual(results[2].transcript, results[2].alternatives[0].transcript, alternatives[0]['transcript']) @@ -580,10 +580,10 @@ def test_stream_recognize(self): alternatives = [{ 'transcript': 'testing streaming 1 2 3', - 'confidence': 0.9224355, + 'confidence': 0.4375, }, { 'transcript': 'testing streaming 4 5 6', - 'confidence': 0.0123456, + 'confidence': 0.84375, }] first_response = _make_streaming_response(