diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-12-30 19:09:49 +0100 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2014-12-30 19:17:15 +0100 |
| commit | 7d80c7d7b6c983cd631986b3c74672389c8916d9 (patch) | |
| tree | e9a7e66082f2603958d8e32fb86c13a8b7653eff /tests/test_stt.py | |
| parent | 74b2639b574ecaf600798d234d93e2d807f63021 (diff) | |
| download | jasper-client-7d80c7d7b6c983cd631986b3c74672389c8916d9.tar.gz jasper-client-7d80c7d7b6c983cd631986b3c74672389c8916d9.zip | |
Split unittests into separate files and move them to tests/
Diffstat (limited to 'tests/test_stt.py')
| -rw-r--r-- | tests/test_stt.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/test_stt.py b/tests/test_stt.py new file mode 100644 index 0000000..267c1c2 --- /dev/null +++ b/tests/test_stt.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8-*- +import unittest +from client import stt, jasperpath + + +class TestSTT(unittest.TestCase): + + def setUp(self): + self.jasper_clip = jasperpath.data('audio', 'jasper.wav') + self.time_clip = jasperpath.data('audio', 'time.wav') + + self.passive_stt_engine = stt.PocketSphinxSTT.get_passive_instance() + self.active_stt_engine = stt.PocketSphinxSTT.get_active_instance() + + def testTranscribeJasper(self): + """ + Does Jasper recognize his name (i.e., passive listen)? + """ + with open(self.jasper_clip, mode="rb") as f: + transcription = self.passive_stt_engine.transcribe(f) + self.assertIn("JASPER", transcription) + + def testTranscribe(self): + """ + Does Jasper recognize 'time' (i.e., active listen)? + """ + with open(self.time_clip, mode="rb") as f: + transcription = self.active_stt_engine.transcribe(f) + self.assertIn("TIME", transcription) |
