diff --git a/tests/test_history.py b/tests/test_history.py index a8ff8121..dc558da6 100644 --- a/tests/test_history.py +++ b/tests/test_history.py @@ -1,5 +1,15 @@ import datetime import unittest +import os +import sys +# Get the current script's directory +current_dir = os.path.dirname(os.path.abspath(__file__)) + +# Get the parent directory +parent_dir = os.path.dirname(current_dir) + +# Add the parent directory to the Python path +sys.path.append(parent_dir) from service import history diff --git a/tests/test_module.py b/tests/test_module.py deleted file mode 100644 index fa222125..00000000 --- a/tests/test_module.py +++ /dev/null @@ -1,47 +0,0 @@ -import unittest -# from application import app - - -class BasicTestCase(unittest.TestCase): - - def test_logout(self): - pass - - # self.app = app.test_client() - # ans =self.app.get('/logout') - # self.assertEqual(ans.status_code, 200) - - # def test_home(self): - # self.app = app.test_client() - # ans =self.app.get('/home') - # self.assertEqual(ans.status_code, 302) - - # def test_login(self): - # self.app = app.test_client() - # ans =self.app.get('/login') - # self.assertEqual(ans.status_code, 200) - - # def test_register(self): - # self.app = app.test_client() - # ans =self.app.get('/register') - # self.assertEqual(ans.status_code, 200) - - # def test_dashboard(self): - # self.app = app.test_client() - # ans =self.app.get('/dashboard') - # self.assertEqual(ans.status_code, 200) - - # def test_friends(self): - # self.app= app.test_client() - # ans=self.app.get('/friends') - # self.assertEqual(ans.status_code, 200) - - # def test_calories(self): - # self.app= app.test_client() - # ans=self.app.get('/calories') - # self.assertEqual(ans.status_code, 302) - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/tests/test_profile.py b/tests/test_profile.py deleted file mode 100644 index 3816cc02..00000000 --- a/tests/test_profile.py +++ /dev/null @@ -1,19 +0,0 @@ -# import pytest -# from unittest.mock import patch -# from application import app -# import mongomock - -# @pytest.fixture -# def client(): -# with mongomock.patch(): -# with app.test_client() as client: -# yield client - -# def test_get_user_profile(client): -# db = mongomock.MongoClient().db - -# db.items.insert_one( -# {"email":"ojaskulkarni100@gmail.com" ,"weight":90, "height":180, "target_weight":80,"goal":"75"}, -# ) -# response = client.get("/user_profile") -# assert response.status_code == 302 diff --git a/tests/test_register.py b/tests/test_register.py deleted file mode 100644 index 4251af47..00000000 --- a/tests/test_register.py +++ /dev/null @@ -1,24 +0,0 @@ -import pytest -# from application import app - -# @pytest.fixture -# def client(): -# with mongomock.patch(): -# with app.test_client() as client: -# yield client - -# def test_get_user(client): -# db = mongomock.MongoClient().db -# db.items.insert_one( -# {"name": "OjasTest", "pwd":"hshaksjn", "weight":90, "height":180, "target_weight":80, "start_date":"2023-10-15", "target_date": -# "2023-11-15"}, -# ) -# response = client.get("/register") -# assert response.status_code == 200 - -# def test_insert_user(client): -# # Make a POST request to the /items endpoint with a JSON payload -# response = client.post("/register", json={"name": "OjasTest", "pwd":"hshaksjn", "weight":"90", "height":"180", "target_weight":"80", "start_date":"2023-10-15", "target_date": -# "2023-11-15"}) -# # Assert the response status code is 201 Created -# assert response.status_code == 200