Skip to content

Commit

Permalink
setup mltests
Browse files Browse the repository at this point in the history
  • Loading branch information
kingslayerrq committed Nov 28, 2023
1 parent c755af0 commit bab4ab8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
Binary file added machine-learning-client/tests/Recording.aiff
Binary file not shown.
Empty file.
14 changes: 14 additions & 0 deletions machine-learning-client/tests/ml_tests.py
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 added machine-learning-client/tests/richard.aiff
Binary file not shown.

0 comments on commit bab4ab8

Please sign in to comment.