From 72d9a686b4560dd468a35806989d3925dccdfa60 Mon Sep 17 00:00:00 2001 From: MarayahAy <83350135+MarayahAy@users.noreply.github.com> Date: Tue, 11 May 2021 18:19:14 -0400 Subject: [PATCH 1/2] first steps --- Recipes Project.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/Recipes Project.py b/Recipes Project.py index c759e01..3b9714e 100644 --- a/Recipes Project.py +++ b/Recipes Project.py @@ -1,2 +1,23 @@ -x = 2+2 -print (x) +#asking for available ingredients""" +ingredients = input("what ingredients do you have available? (please seperate each with a comma)") +print ('okay let me check what recipes we have available with', ingredients, '...') + + +#importing recipes and store in dict varibale +import csv +recipes = csv.DictReader(open('recipes.csv')) +for row in recipes: + print(row) + +def recipes(documentation): +""" Description of the function +Input: +Ingredients that are available to user + +Output: +All recipes that require only those ingredients + +""" + return documentation + + From 6100eed506e84b8557d52f20ec950eb81ab98704 Mon Sep 17 00:00:00 2001 From: MarayahAy <83350135+MarayahAy@users.noreply.github.com> Date: Tue, 18 May 2021 20:29:58 -0400 Subject: [PATCH 2/2] Create unittest_example.py Example of unittest --- Test/unittest_example.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Test/unittest_example.py diff --git a/Test/unittest_example.py b/Test/unittest_example.py new file mode 100644 index 0000000..2545e79 --- /dev/null +++ b/Test/unittest_example.py @@ -0,0 +1,12 @@ +import unittest + +class TestSum(unittest.TestCase): +#this one should pass the test + def test_sum(self): + self.assertEqual(sum([2, 2, 3]), 7, "Correct answer is 7") +#this one should not pass the test (testing the test in this case..) + def test_sum_opposite(self): + self.assertEqual(sum((1, 2, 3)), 7, "Correct answer is 7") + +if __name__ == '__main__': + unittest.main()