Skip to content

Commit 97599b5

Browse files
authored
Add files via upload
1 parent 436ffe1 commit 97599b5

File tree

1 file changed

+74
-4
lines changed

1 file changed

+74
-4
lines changed

swagger_server/test/test_default_controller.py

Lines changed: 74 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from swagger_server.models.branded_food_object import BrandedFoodObject # noqa: E501
99
from swagger_server.models.ingredient_object import IngredientObject # noqa: E501
10+
from swagger_server.models.recipe_object import RecipeObject # noqa: E501
1011
from swagger_server.test import BaseTestCase
1112

1213

@@ -18,7 +19,8 @@ def test_food_branded_barcode_php_get(self):
1819
1920
Get a branded food item using a barcode
2021
"""
21-
query_string = [('code', 'code_example')]
22+
query_string = [('code', 'code_example'),
23+
('user_id', 'user_id_example')]
2224
response = self.client.open(
2325
'/api/v2/food/branded/barcode.php',
2426
method='GET',
@@ -33,7 +35,8 @@ def test_food_branded_name_php_get(self):
3335
"""
3436
query_string = [('name', 'name_example'),
3537
('limit', 56),
36-
('page', 56)]
38+
('page', 56),
39+
('user_id', 'user_id_example')]
3740
response = self.client.open(
3841
'/api/v2/food/branded/name.php',
3942
method='GET',
@@ -59,7 +62,8 @@ def test_food_branded_search_php_get(self):
5962
('trace', 'trace_example'),
6063
('vitamin', 'vitamin_example'),
6164
('limit', 56),
62-
('page', 56)]
65+
('page', 56),
66+
('user_id', 'user_id_example')]
6367
response = self.client.open(
6468
'/api/v2/food/branded/search.php',
6569
method='GET',
@@ -73,14 +77,80 @@ def test_food_ingredient_search_php_get(self):
7377
Get raw/generic food ingredient item(s)
7478
"""
7579
query_string = [('find', 'find_example'),
76-
('limit', 56)]
80+
('limit', 56),
81+
('user_id', 'user_id_example')]
7782
response = self.client.open(
7883
'/api/v2/food/ingredient/search.php',
7984
method='GET',
8085
query_string=query_string)
8186
self.assert200(response,
8287
'Response body is : ' + response.data.decode('utf-8'))
8388

89+
def test_recipe_id_php_get(self):
90+
"""Test case for recipe_id_php_get
91+
92+
Get a recipe by ID
93+
"""
94+
query_string = [('id', 'id_example'),
95+
('user_id', 'user_id_example')]
96+
response = self.client.open(
97+
'/api/v2/recipe/id.php',
98+
method='GET',
99+
query_string=query_string)
100+
self.assert200(response,
101+
'Response body is : ' + response.data.decode('utf-8'))
102+
103+
def test_recipe_ingredient_php_get(self):
104+
"""Test case for recipe_ingredient_php_get
105+
106+
Get recipes using a list of ingredients
107+
"""
108+
query_string = [('list', 'list_example'),
109+
('limit', 56),
110+
('page', 56),
111+
('user_id', 'user_id_example')]
112+
response = self.client.open(
113+
'/api/v2/recipe/ingredient.php',
114+
method='GET',
115+
query_string=query_string)
116+
self.assert200(response,
117+
'Response body is : ' + response.data.decode('utf-8'))
118+
119+
def test_recipe_random_php_get(self):
120+
"""Test case for recipe_random_php_get
121+
122+
Get random popular recipes
123+
"""
124+
query_string = [('limit', 56),
125+
('user_id', 'user_id_example')]
126+
response = self.client.open(
127+
'/api/v2/recipe/random.php',
128+
method='GET',
129+
query_string=query_string)
130+
self.assert200(response,
131+
'Response body is : ' + response.data.decode('utf-8'))
132+
133+
def test_recipe_search_php_get(self):
134+
"""Test case for recipe_search_php_get
135+
136+
Get recipes using a title and optional filters
137+
"""
138+
query_string = [('title', 'title_example'),
139+
('excluded_cuisine', 'excluded_cuisine_example'),
140+
('included_cuisine', 'included_cuisine_example'),
141+
('excluded_ingredient', 'excluded_ingredient_example'),
142+
('included_ingredient', 'included_ingredient_example'),
143+
('nutrients_required', 56),
144+
('limit', 56),
145+
('page', 56),
146+
('user_id', 'user_id_example')]
147+
response = self.client.open(
148+
'/api/v2/recipe/search.php',
149+
method='GET',
150+
query_string=query_string)
151+
self.assert200(response,
152+
'Response body is : ' + response.data.decode('utf-8'))
153+
84154

85155
if __name__ == '__main__':
86156
import unittest

0 commit comments

Comments
 (0)