From 3ba5a8a2a4d8fe49c21b568245cd610ecff26ead Mon Sep 17 00:00:00 2001 From: Pranav Rastogi Date: Wed, 9 Aug 2023 12:51:03 -0700 Subject: [PATCH 1/7] Updated config.yml --- .circleci/config.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 851bd41..c87cf06 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -38,4 +38,11 @@ jobs: - run: name: Run tests # This assumes pytest is installed via the install-package step above - command: pytest + command: | + . venv/bin/activate + mkdir test-results + pytest --junitxml=test-results/junit.xml + + - store_test_results: + path: test-results + From b910d27febbfa87524b4f493868bffd5fed1dc68 Mon Sep 17 00:00:00 2001 From: Pranav Rastogi Date: Wed, 9 Aug 2023 12:53:26 -0700 Subject: [PATCH 2/7] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c87cf06..fb18c06 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -38,8 +38,8 @@ jobs: - run: name: Run tests # This assumes pytest is installed via the install-package step above + # . venv/bin/activate command: | - . venv/bin/activate mkdir test-results pytest --junitxml=test-results/junit.xml From 8f6565a0654c7af92c17443464886a8b22b4b74b Mon Sep 17 00:00:00 2001 From: Pranav Rastogi Date: Wed, 9 Aug 2023 13:03:43 -0700 Subject: [PATCH 3/7] Updated config.yml --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index fb18c06..88986c8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,3 +46,6 @@ jobs: - store_test_results: path: test-results + - store_artifacts: + path: test-results + destination: junit \ No newline at end of file From 1a1d2d717813f2d69a38d4ed122c000c6f3733e1 Mon Sep 17 00:00:00 2001 From: Pranav Rastogi Date: Wed, 9 Aug 2023 13:30:16 -0700 Subject: [PATCH 4/7] Update configure.py --- configure.py | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.py b/configure.py index ae6261f..9dfdd0c 100644 --- a/configure.py +++ b/configure.py @@ -16,3 +16,4 @@ def seed_db(): if __name__ == "__main__": create_db() + From 1a8de4cdd12fc1dca4334562f104a0cb4514d4a3 Mon Sep 17 00:00:00 2001 From: Pranav Rastogi Date: Thu, 10 Aug 2023 10:49:30 -0700 Subject: [PATCH 5/7] Update test_image_controller.py --- openapi_server/test/test_image_controller.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openapi_server/test/test_image_controller.py b/openapi_server/test/test_image_controller.py index c1c8076..3579093 100644 --- a/openapi_server/test/test_image_controller.py +++ b/openapi_server/test/test_image_controller.py @@ -1,6 +1,7 @@ # coding: utf-8 from __future__ import absolute_import +import time import unittest from unittest import mock @@ -44,6 +45,7 @@ def test_add_image(self, mock_add): data=data, content_type="multipart/form-data", ) + time.sleep(60) self.assert200(response, "Response body is : " + response.data.decode("utf-8")) @mock.patch.object(models.Image, "delete_image") @@ -63,6 +65,7 @@ def test_delete_image(self, mock_delete): self.assertStatus( response, 204, "Response body is : " + response.data.decode("utf-8") ) + time.sleep(60) assert mock_delete.call_count == 1 @mock.patch.object(models.Image, "get_image") @@ -80,6 +83,7 @@ def test_get_image(self, mock_get): method="GET", headers=headers, ) + time.sleep(60) self.assert200(response) From 99433d9ca92577f791695c205895814825319dc2 Mon Sep 17 00:00:00 2001 From: Pranav Rastogi Date: Thu, 10 Aug 2023 17:48:05 -0700 Subject: [PATCH 6/7] Update test_image_controller.py --- openapi_server/test/test_image_controller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openapi_server/test/test_image_controller.py b/openapi_server/test/test_image_controller.py index 3579093..5a5b51b 100644 --- a/openapi_server/test/test_image_controller.py +++ b/openapi_server/test/test_image_controller.py @@ -45,7 +45,7 @@ def test_add_image(self, mock_add): data=data, content_type="multipart/form-data", ) - time.sleep(60) + time.sleep(70) self.assert200(response, "Response body is : " + response.data.decode("utf-8")) @mock.patch.object(models.Image, "delete_image") @@ -83,7 +83,7 @@ def test_get_image(self, mock_get): method="GET", headers=headers, ) - time.sleep(60) + time.sleep(100) self.assert200(response) From a911513b3546603137aefceb1c330981a45790ef Mon Sep 17 00:00:00 2001 From: Pranav Rastogi Date: Thu, 10 Aug 2023 17:53:55 -0700 Subject: [PATCH 7/7] Add new test test_menu_controller.py --- openapi_server/test/test_menu_controller.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/openapi_server/test/test_menu_controller.py b/openapi_server/test/test_menu_controller.py index 3557070..d5f44f5 100644 --- a/openapi_server/test/test_menu_controller.py +++ b/openapi_server/test/test_menu_controller.py @@ -83,6 +83,20 @@ def test_show_menu_item_by_id(self, mock_query): ) self.assert200(response, "Response body is : " + response.data.decode("utf-8")) + @mock.patch.object(models.MenuItem, "query_by_id") + def test_show_menu_item_by_id2(self, mock_query): + """Test case for show_menu_item_by_id + + Info for a specific menu item + """ + mock_query.return_value = self.sample_model + headers = { + "Accept": "application/json", + } + response = self.client.open( + "/CFD/1.0.0/menu/{item_id}".format(item_id=0), method="GET", headers=headers + ) + self.assert200(response, "Response body is : " + response.data.decode("utf-8")) if __name__ == "__main__": unittest.main()