Browse files

Fix tests broken from Bing changes

  • Loading branch information...
Uberi committed Jul 18, 2017
1 parent 566a70b commit 2dc157a673303c6da15494017f706685df9777ca
Showing with 3 additions and 3 deletions.
  1. +2 −2 speech_recognition/
  2. +1 −1 tests/
@@ -934,9 +934,9 @@ def recognize_bing(self, audio_data, key, language="en-US", show_all=False):
credential_response = urlopen(credential_request, timeout=self.operation_timeout)
except HTTPError as e:
raise RequestError("recognition request failed: {}".format(e.reason))
raise RequestError("credential request failed: {}".format(e.reason))
except URLError as e:
raise RequestError("recognition connection failed: {}".format(e.reason))
raise RequestError("credential connection failed: {}".format(e.reason))
access_token ="utf-8")
if allow_caching:
@@ -49,7 +49,7 @@ def test_bing_english(self):
def test_bing_french(self):
r = sr.Recognizer()
with sr.AudioFile(self.AUDIO_FILE_FR) as source: audio = r.record(source)
self.assertEqual(r.recognize_bing(audio, key=os.environ["BING_KEY"], language="fr-FR"), u"Et c'est la dictée numéro un.")
self.assertEqual(r.recognize_bing(audio, key=os.environ["BING_KEY"], language="fr-FR"), u"Essaye la dictée numéro un.")
@unittest.skipUnless("BING_KEY" in os.environ, "requires Microsoft Bing Voice Recognition key to be specified in BING_KEY environment variable")
def test_bing_chinese(self):

0 comments on commit 2dc157a

Please sign in to comment.