-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
8 changed files
with
59 additions
and
63 deletions.
There are no files selected for viewing
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
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
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
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,43 @@ | ||
import unittest | ||
from fastapi.testclient import TestClient | ||
from whisper_api import app | ||
|
||
""" | ||
Test that the frontend files are served correctly. | ||
""" | ||
|
||
client = TestClient(app) | ||
|
||
|
||
class TestFrontend(unittest.TestCase): | ||
|
||
def test_index_html(self): | ||
""" | ||
Test that the index.html file is served correctly. | ||
""" | ||
response = client.get("/index.html") | ||
assert response.status_code == 200 | ||
assert response.headers["content-type"] == "text/html; charset=utf-8" | ||
|
||
def test_script_js(self): | ||
""" | ||
Test that the script.js file is served correctly. | ||
""" | ||
response = client.get("/script.js") | ||
assert response.status_code == 200 | ||
assert response.headers["content-type"] == "text/javascript; charset=utf-8" | ||
|
||
def test_styles_css(self): | ||
""" | ||
Test that the styles.css file is served correctly. | ||
""" | ||
response = client.get("/styles.css") | ||
assert response.status_code == 200 | ||
assert response.headers["content-type"] == "text/css; charset=utf-8" | ||
|
||
def test_not_found(self): | ||
""" | ||
Test that a 404 error is returned when a file is not found. | ||
""" | ||
response = client.get("/not_found") | ||
assert response.status_code == 404 |
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,11 @@ | ||
import unittest | ||
|
||
|
||
class TestImport(unittest.TestCase): | ||
|
||
def test_import_whisper_api(self): | ||
try: | ||
import whisper_api | ||
assert whisper_api | ||
except ImportError: | ||
unittest.fail("Failed to import whisper_api") |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.