diff --git a/scripts/create_database.py b/scripts/create_database.py index b8faef9..9c8f1b8 100644 --- a/scripts/create_database.py +++ b/scripts/create_database.py @@ -41,6 +41,7 @@ def create_connection(path: str, filename: str): if __name__ == "__main__": run() + def run(): """ Create the database for the application""" dir = r"./data/" diff --git a/tests/__init__.py b/tests/__init__.py index 59f2e74..b79d54f 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -16,6 +16,7 @@ os.environ["ENVIRON"] = "test" run() + @pytest.fixture(scope="module") def test_client() -> FlaskClient: """ Enables tests to create requests to the web app diff --git a/tests/endtoend/use_cases_test.py b/tests/endtoend/use_cases_test.py index e9f315c..17babdc 100644 --- a/tests/endtoend/use_cases_test.py +++ b/tests/endtoend/use_cases_test.py @@ -3,6 +3,7 @@ from bs4 import BeautifulSoup from tests import test_client from flask.testing import FlaskClient -# def test_use_case(test_client: FlaskClient): -# response = test_client.get('/products/Car Parts') -# assert response.status_code == 200 \ No newline at end of file + +def test_use_case(test_client: FlaskClient): + response = test_client.get('/products/Car Parts') + assert response.status_code == 200 diff --git a/tests/unit/database/__init__.py b/tests/unit/database/__init__.py index 2257c58..e69de29 100644 --- a/tests/unit/database/__init__.py +++ b/tests/unit/database/__init__.py @@ -1,2 +0,0 @@ -# Ensure test environment is set before using -# Runs the database creation scripts \ No newline at end of file