From b3e07ab43c19d72a2b815f9ec31d351c2a80ed16 Mon Sep 17 00:00:00 2001 From: kingslayerrq Date: Fri, 1 Dec 2023 15:09:16 -0500 Subject: [PATCH] make testcase filepath general --- machine-learning-client/tests/ml_tests.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/machine-learning-client/tests/ml_tests.py b/machine-learning-client/tests/ml_tests.py index 693df8b..fbab0ff 100644 --- a/machine-learning-client/tests/ml_tests.py +++ b/machine-learning-client/tests/ml_tests.py @@ -2,17 +2,19 @@ tests for machine-learning-client """ from machine_learning_client import ML - +import os class Tests: """Tests class for ml_tests.py""" - def test_audio_text_conversion(self): """testing audio_to_text function in ML with valid audiofile as input""" + PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) + tests_path = "tests" + file_name = "richard.aiff" + file_path = os.path.join(PROJECT_ROOT, tests_path, file_name) + print(file_path) actual = ML.audio_to_text( - self, - r"C:\Users\Administrator\Desktop\NYU_Undergrad\SoftwareEngineering" - r"\4-containerized-app-exercise-rizzballs\machine-learning-client\tests\richard.aiff", + self, file_path ) assert isinstance( actual, str