Permalink
Browse files

Fix tests

  • Loading branch information...
Uberi committed Dec 5, 2017
1 parent c8b1f3a commit f1bb4153ae880965faaa058ce479fae95284d3b5
Showing with 4 additions and 5 deletions.
  1. +1 −1 .travis.yml
  2. +1 −1 README.rst
  3. +1 −2 speech_recognition/__init__.py
  4. +1 −1 tests/test_recognition.py
View
@@ -19,7 +19,7 @@ install:
- pip install flake8 rstcheck
- pip install -e .
script:
- flake8 --ignore=E501,E701 speech_recognition tests examples setup.py # ignore errors for long lines and multi-statement lines
- flake8 --ignore=E501,E701,E722 speech_recognition tests examples setup.py # ignore errors for long lines, multi-statement lines, and bare except
- rstcheck README.rst reference/*.rst # ensure RST is well-formed
- python -m unittest discover --verbose # run unit tests
sudo: false # this allows TravisCI to use the fast Docker build environment rather than the slower VMs
View
@@ -298,7 +298,7 @@ Testing is also done automatically by TravisCI, upon every push. To set up the e
sudo apt-get update && sudo apt-get install swig libpulse-dev
pip install --user pocketsphinx monotonic && pip install --user flake8 rstcheck && pip install --user -e .
python -m unittest discover --verbose # run unit tests
python -m flake8 --ignore=E501,E701 speech_recognition tests examples setup.py # ignore errors for long lines and multi-statement lines
python -m flake8 --ignore=E501,E701,722 speech_recognition tests examples setup.py # ignore errors for long lines, multi-statement lines, and bare except
python -m rstcheck README.rst reference/*.rst # ensure RST is well-formed
FLAC Executables
@@ -20,7 +20,6 @@
import hmac
import time
import uuid
import sys
import struct
__author__ = "Anthony Zhang (Uberi)"
@@ -306,7 +305,7 @@ def __init__(self, frame_data, sample_rate, sample_width):
self.sample_rate = sample_rate
self.sample_width = int(sample_width)
def get_segment(self, start_ms = None, end_ms = None):
def get_segment(self, start_ms=None, end_ms=None):
"""
Returns a new ``AudioData`` instance, trimmed to a given time interval. In other words, an ``AudioData`` instance with the same audio data except starting at ``start_ms`` milliseconds in and ending ``end_ms`` milliseconds in.
@@ -21,7 +21,7 @@ def test_sphinx_english(self):
def test_google_english(self):
r = sr.Recognizer()
with sr.AudioFile(self.AUDIO_FILE_EN) as source: audio = r.record(source)
self.assertEqual(r.recognize_google(audio), "1 2 3")
self.assertIn(r.recognize_google(audio), ["1 2 3", "one two three"])
def test_google_french(self):
r = sr.Recognizer()

0 comments on commit f1bb415

Please sign in to comment.