summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2014-10-04 13:14:22 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2014-10-06 17:11:12 +0200
commit93839394797d6f8d16967f875b189fb67a95aea3 (patch)
treece56990f0e232096af139caef9059b70692f5f6c
parentedca8b7407d7c9b1497ba1722d1b66ffa4b4c234 (diff)
downloadjasper-client-93839394797d6f8d16967f875b189fb67a95aea3.tar.gz
jasper-client-93839394797d6f8d16967f875b189fb67a95aea3.zip
Fix TestMic testcase
This fixes jasperproject/jasper-client#212
-rw-r--r--client/test.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/client/test.py b/client/test.py
index 7366ef2..6eaaa5a 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,14 +69,20 @@ 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)
+ """
+ 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.assertTrue("JASPER" in transcription)
def testTranscribe(self):
- """Does Jasper recognize 'time' (i.e., active listen)?"""
- transcription = self.stt.transcribe(self.time_clip)
+ """
+ Does Jasper recognize 'time' (i.e., active listen)?
+ """
+ with open(self.time_clip, mode="rb") as f:
+ transcription = self.stt.transcribe(f)
self.assertTrue("TIME" in transcription)