Skip to content

Commit

Permalink
Fix build failing with float precision mismatch (#3002)
Browse files Browse the repository at this point in the history
  • Loading branch information
daspecster authored and lukesneeringer committed Feb 14, 2017
1 parent bafed15 commit 795054f
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions packages/google-cloud-speech/unit_tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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 = []
Expand Down Expand Up @@ -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,
Expand All @@ -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'])
Expand All @@ -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(
Expand Down

0 comments on commit 795054f

Please sign in to comment.