import unittest # Make a dictionary called fruits_dict with fruit names as keys and the color of the fruit as values. Us
Posted: Thu Jul 14, 2022 2:13 pm
import unittest
# Make a dictionary called fruits_dict with fruit names as keysand the color of the fruit as values. Use the following key-valuepairs.# Key | Value# --------------# Apple | Red# Banana | Yellow# Kiwi | Green
def q1a(): # Insert your code return {} # Replace with fruits_dict as describedabove
class TestQuestion1a(unittest.TestCase):
def test_dict_vals(self): fruits_dict = q1a() self.assertIn('Apple',fruits_dict) self.assertIn('Banana',fruits_dict) self.assertIn('Kiwi',fruits_dict) self.assertEqual(fruits_dict['Apple'], 'Red') self.assertEqual(fruits_dict['Banana'], 'Yellow') self.assertEqual(fruits_dict['Kiwi'], 'Green')if __name__ == '__main__': unittest.main()
# Make a dictionary called fruits_dict with fruit names as keysand the color of the fruit as values. Use the following key-valuepairs.# Key | Value# --------------# Apple | Red# Banana | Yellow# Kiwi | Green
def q1a(): # Insert your code return {} # Replace with fruits_dict as describedabove
class TestQuestion1a(unittest.TestCase):
def test_dict_vals(self): fruits_dict = q1a() self.assertIn('Apple',fruits_dict) self.assertIn('Banana',fruits_dict) self.assertIn('Kiwi',fruits_dict) self.assertEqual(fruits_dict['Apple'], 'Red') self.assertEqual(fruits_dict['Banana'], 'Yellow') self.assertEqual(fruits_dict['Kiwi'], 'Green')if __name__ == '__main__': unittest.main()