diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-10-06 18:14:49 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2014-10-06 18:14:49 +0200 |
| commit | 016cc20ad8605371e820e509f9881c2750019d09 (patch) | |
| tree | 6a901ec10f957d1a0edd79b410c384ed010ac4e7 /client/test.py | |
| parent | 9cac8eb715e90b1f30105480e1abf7f027302fbd (diff) | |
| parent | 735069a6d692b704393aa0b4e042678f29f56c6e (diff) | |
| download | jasper-client-016cc20ad8605371e820e509f9881c2750019d09.tar.gz jasper-client-016cc20ad8605371e820e509f9881c2750019d09.zip | |
Merge pull request #213 from Holzhaus/fix-mic-tests
Fix TestMic testcase
Diffstat (limited to 'client/test.py')
| -rw-r--r-- | client/test.py | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/client/test.py b/client/test.py index 7366ef2..d9ca8f5 100644 --- a/client/test.py +++ b/client/test.py @@ -13,6 +13,7 @@ import g2p import brain import jasperpath import tts +from stt import TranscriptionMode from diagnose import Diagnostics DEFAULT_PROFILE = { @@ -68,15 +69,21 @@ class TestMic(unittest.TestCase): self.stt = PocketSphinxSTT() def testTranscribeJasper(self): - """Does Jasper recognize his name (i.e., passive listen)?""" - transcription = self.stt.transcribe(self.jasper_clip, - PERSONA_ONLY=True) - self.assertTrue("JASPER" in transcription) + """ + Does Jasper recognize his name (i.e., passive listen)? + """ + with open(self.jasper_clip, mode="rb") as f: + transcription = self.stt.transcribe(f, + mode=TranscriptionMode.KEYWORD) + self.assertIn("JASPER", transcription) def testTranscribe(self): - """Does Jasper recognize 'time' (i.e., active listen)?""" - transcription = self.stt.transcribe(self.time_clip) - self.assertTrue("TIME" in transcription) + """ + Does Jasper recognize 'time' (i.e., active listen)? + """ + with open(self.time_clip, mode="rb") as f: + transcription = self.stt.transcribe(f) + self.assertIn("TIME", transcription) class TestG2P(unittest.TestCase): |
