-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_APIrequests.py
More file actions
27 lines (20 loc) · 1.03 KB
/
test_APIrequests.py
File metadata and controls
27 lines (20 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import unittest
from APIrequests import APIrequests
class testAPI(unittest.TestCase):
def test_foodSearch(self):
testSession=APIrequests()
response=testSession.foodSearch('potato%20rice','rating')
self.assertEqual(response,'086443')
response=testSession.foodSearch('chicken%20cheese','rating')
self.assertEqual(response,'e7fdb2')
def test_getRecipeDetails(self):
testSession = APIrequests()
response = testSession.getRecipeDetails('086443')
#print(response)
self.assertEqual(response, {'ingredients': ['1 recipe for chipotle squash skewers', '1 cups cooked brown rice',\
' tablespoon olive oil', '1 clove garlic', 'Juice from one lime',\
'Handful of fresh cilantro, roughly chopped.'], \
'name': 'Chipotle Sweet Potato Skewers with Cilantro Lime Rice'}
)
if __name__=="__main__":
unittest.main()