Skip to content

Commit

Permalink
Merge pull request #7 from milahu/merge-Uberi-pr574-e693e43-Fix-build…
Browse files Browse the repository at this point in the history
…-by-yoe

Merge uberi pr574 e693e43 allow offline tests by yoe
  • Loading branch information
milahu authored Mar 5, 2022
2 parents 2191d3f + 52c7ab4 commit c0d3e62
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/test_recognition.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@ def test_sphinx_english(self):
with sr.AudioFile(self.AUDIO_FILE_EN) as source: audio = r.record(source)
self.assertEqual(r.recognize_sphinx(audio), "one two three")

@unittest.skipIf("SKIP_ONLINE" in os.environ, "online tests disabled")
def test_google_english(self):
r = sr.Recognizer()
with sr.AudioFile(self.AUDIO_FILE_EN) as source: audio = r.record(source)
self.assertIn(r.recognize_google(audio), ["1 2 3", "one two three", "123"])

@unittest.skipIf("SKIP_ONLINE" in os.environ, "online tests disabled")
def test_google_french(self):
r = sr.Recognizer()
with sr.AudioFile(self.AUDIO_FILE_FR) as source: audio = r.record(source)
self.assertEqual(r.recognize_google(audio, language="fr-FR"), u"et c'est la dictée numéro 1")

@unittest.skipIf("SKIP_ONLINE" in os.environ, "online tests disabled")
def test_google_chinese(self):
r = sr.Recognizer()
with sr.AudioFile(self.AUDIO_FILE_ZH) as source: audio = r.record(source)
Expand Down

0 comments on commit c0d3e62

Please sign in to comment.