-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'neha-1' of https://github.com/utsavll0/calorieApp_server …
…into neha-1
- Loading branch information
Showing
7 changed files
with
95 additions
and
59 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,47 @@ | ||
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 | ||
|
||
# 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, 200) | ||
# | ||
# def test_user_profile(self): | ||
# self.app= app.test_client() | ||
# ans=self.app.get('/user_profile') | ||
# self.assertEqual(ans.status_code, 200) | ||
# | ||
# def test_history(self): | ||
# self.app= app.test_client() | ||
# ans=self.app.get('/history') | ||
# self.assertEqual(ans.status_code, 200) | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |
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,19 @@ | ||
# 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":"[email protected]" ,"weight":90, "height":180, "target_weight":80,"goal":"75"}, | ||
# ) | ||
# response = client.get("/user_profile") | ||
# assert response.status_code == 302 |
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,24 @@ | ||
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 |