Skip to content

Commit

Permalink
reformatting with black
Browse files Browse the repository at this point in the history
  • Loading branch information
KeiOshima committed Nov 30, 2023
1 parent d82c8ef commit 82e7fec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
12 changes: 6 additions & 6 deletions machine-learning-client/tests/ml_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
from machine_learning_client import ML




class Tests:
""" Tests class for ml_tests.py """
"""Tests class for ml_tests.py"""

def test_audio_text_conversion(self):
"""testing audio_to_text function in ML with valid audiofile as input"""
actual = ML.audio_to_text(self,
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"
r"\4-containerized-app-exercise-rizzballs\machine-learning-client\tests\richard.aiff",
)
assert isinstance(
actual, str
Expand All @@ -30,5 +30,5 @@ def test_grade_response(self):
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 \
), f"Expected the result to be 'your response had hello appearing 5 times \
ugh appearing 0 times '. Instead it returned {actual}"
11 changes: 4 additions & 7 deletions web-app/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

"""
app.py file that helps serve as the front end of our application
"""
Expand Down Expand Up @@ -39,13 +38,13 @@ def analyze_data():
result = subprocess.run(
[
"C:\\Users\\Andrew - User\\AppData\\Local\\Microsoft\\WindowsApps\\python.exe",
"E:\\4-containerized-app-exercise-rizzballs\\machine-learning-client\\machine_learning_client.py", # pylint: disable=line-too-long
audio_path, # pylint: disable=line-too-long disable=trailing-whitespace
"E:\\4-containerized-app-exercise-rizzballs\\machine-learning-client\\machine_learning_client.py", # pylint: disable=line-too-long
audio_path, # pylint: disable=line-too-long disable=trailing-whitespace
],
capture_output=True,
text=True,
check=True
)
check=True,
)
if result.returncode == 0:
print("Process succeeded!")
else:
Expand All @@ -60,8 +59,6 @@ def analyze_data():
return jsonify({"status": "error", "message": f"Subprocess failed: {str(e)}"})




if __name__ == "__main__":
PORT = os.getenv("PORT", "5000")
app.run(debug=True, port=PORT)

0 comments on commit 82e7fec

Please sign in to comment.