@@ -0,0 +1,2037 @@
+# Copyright 2017 Google Inc.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A#     http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable law or agreed to in writing, software%0A# distributed under the License is distributed on an %22AS IS%22 BASIS,%0A# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A# See the License for the specific language governing permissions and%0A# limitations under the License.%0A%0Aimport unittest%0A%0A%0Aclass TestResult(unittest.TestCase):%0A    @staticmethod%0A    def _get_target_class():%0A        from google.cloud.speech.result import Result%0A%0A        return Result%0A%0A    def _make_one(self, *args, **kw):%0A        return self._get_target_class()(*args, **kw)%0A%0A    def test_ctor(self):%0A        result = self._make_one(%5B%5D)%0A        self.assertIsInstance(result, self._get_target_class())%0A%0A    def test_from_pb(self):%0A        from google.cloud.proto.speech.v1beta1 import cloud_speech_pb2%0A%0A        confidence = 0.625%0A        transcript = 'this is a test transcript'%0A        alternative = cloud_speech_pb2.SpeechRecognitionAlternative(%0A            transcript=transcript, confidence=confidence)%0A        result_pb = cloud_speech_pb2.SpeechRecognitionResult(%0A            alternatives=%5Balternative%5D)%0A%0A        result = self._get_target_class().from_pb(result_pb)%0A        self.assertEqual(result.confidence, confidence)%0A        self.assertEqual(result.transcript, transcript)%0A%0A    def test_from_api_repr(self):%0A        confidence = 0.625%0A        transcript = 'this is a test'%0A        response = %7B%0A            'alternatives': %5B%0A                %7B%0A                    'confidence': confidence,%0A                    'transcript': transcript,%0A                %7D,%0A            %5D,%0A        %7D%0A%0A        result = self._get_target_class().from_api_repr(response)%0A        self.assertEqual(result.confidence, confidence)%0A        self.assertEqual(result.transcript, transcript)%0A

Add test file for Result class.