generated from nyu-software-engineering/containerized-app-exercise
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c755af0
commit bab4ab8
Showing
4 changed files
with
14 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from machine_learning_client import ML | ||
import speech_recognition as sr | ||
import pytest | ||
|
||
class Tests: | ||
def test_audio_text_conversion(self): | ||
actual = ML.audio_to_text(r"C:\Users\Administrator\Desktop\NYU_Undergrad\SoftwareEngineering\4-containerized-app-exercise-rizzballs\machine-learning-client\tests\richard.aiff") | ||
assert isinstance(actual, str), f"Expected audio_to_text to return a string. Instead it returned a {actual}" | ||
assert actual.lower() == "my name is richard", f"Expected the converted audio to be 'my name is richard'. Instead it returned {actual}" | ||
|
||
def test_grade_response(self): | ||
actual = ML.grade_response("hello hello hello hello hello") | ||
assert isinstance(actual, str), f"Expected grade_response to return a string. Instead it returned a {actual}" | ||
assert actual.lower() == "your response had hello appearing 5 times ugh appearing 0 times ", f"Expected the result to be 'your response had hello appearing 5 times ugh appearing 0 times '. Instead it returned {actual}" |
Binary file not shown.