for the fifth function - I used the previous function to help me code the count by using the len command that I used for the first function! Easy way to return the number of people who like a given color

This commit is contained in:
erbrown
2025-12-13 20:49:39 -05:00
parent f79959c5a4
commit 0e0962c53d
2 changed files with 11 additions and 10 deletions

View File

@@ -44,16 +44,16 @@ class TestPeopleWhoLikeColor(TestCase):
self.assertEqual(len(people_who_like_color(family, "blue")), 2)
self.assertEqual(len(people_who_like_color(family, "purple")), 0)
# def test_returns_full_dicts(self):
# result = people_who_like_color(family, "orange")
# self.assertEqual(len(result), 1)
# self.assertEqual(result[0]["email"], "auctor.odio@icloud.ca")
def test_returns_full_dicts(self):
result = people_who_like_color(family, "orange")
self.assertEqual(len(result), 1)
self.assertEqual(result[0]["email"], "auctor.odio@icloud.ca")
# class TestCountPeopleWhoLikeColor(TestCase):
# def test_returns_correct_count(self):
# self.assertEqual(count_people_who_like_color(friends, "grey"), 2)
# self.assertEqual(count_people_who_like_color(friends, "beige"), 1)
# self.assertEqual(count_people_who_like_color(friends, "cornflower"), 0)
class TestCountPeopleWhoLikeColor(TestCase):
def test_returns_correct_count(self):
self.assertEqual(count_people_who_like_color(friends, "grey"), 2)
self.assertEqual(count_people_who_like_color(friends, "beige"), 1)
self.assertEqual(count_people_who_like_color(friends, "cornflower"), 0)
# class TestGetColorDict(TestCase):
# def test_returns_correct_dict(self):