Need help with the code, please.
Problem Duration: 2 hours A Dessert Shop sells candy by the pound, cookies by the dozen, ice cream by the scoop, and sundaes (ice cream with a topping). For this part of the project, you will create the structure for a Dessert Shop program. There will be no user interface nor input/output at this time, but there will be later. Your code will be tested using automated test cases. Test code can be simple asserts, unittest code, pytest code, or doctests as long as your set of test cases meets the requirements specified for the project. Whichever you choose, be consistent. is built-in with Python, as are doctests and asserts. is a 3rd-party module but is simpler to write code for than unittest, and it will run unittest code. Whichever you choose, be consistent. To create this framework, you will implement an inheritance hierarchy of classes derived from a Dessertltem superclass. Candy. Cookie, and iceCream classes will derive from the Dessertltem class. The Sundae class will derive from the IceCream class. The classes will be structured as below. Dessertltem Superclass The Dessertitem superclass contains: - name a string attribute - a constructor with one parameter that sets the name attribute to the passed-in value. The default value for the parameter is empty string. Many OO language books and standards teach us that each field must be wrapped in getters and setters to provide functions for accessing and mutating object data. Pythonistas prefer to write getters and setters only if necessary to wrap additional - Dessert Shop Part 1 in getters and setters to provide functions for accessing and mutating object data. Pythonistas prefer to write getters and setters only zf necessary to wrap additional processing around an attribute. Otherwise, we just access the attribute directly. In CS 1410, we will follow the Pythonista way. Derived Subclasses Candy, Cookie, IceCream and Sundae All derived subclasses (Candy, Cookie, IceCream and Sundae) contain: - Attributes as described below - A constructor with enough parameters to initialize all the attributes of the object. including the superclass attribute. All paramters must have reasonable default values. The constructor must call the superclass constructor. The Candy class attributes are: - candy_weight: float - price_per_pound: float The Cookie class attributes are: - cookie_quantity, int - price_per_dozen: float The IceCream class attributes are: - scoop_count int - price_per_scoop: float 1. Dessert Shop Part 1 The IceCream class attributes are: - scoop_count int - price_per_scoop: float The Sundae class attributes are: - topping_name - topping_price Shown here is a typical UML diagram where attributes have declared types and the 1. Dessert Shop Part 1 Shown here is a typical UML diagram where attributes have declared types and the designer used camel case instead of snake case. Specifying types is good in design, even if in Python we don't explicitly declare the types of variables. As for naming. it's different for different languages, even if the design is the same. Many languages push having getters and setters for accessing and modifying attributes as discussed in your readings. Pythonistas generally avoid getters and setters unless there is a good reason NOT to access an attribute directly. Test Cases Create simple test cases for your code as described here. The test cases are used to grade your code. You may use the built-in unittest module, you may use pytest. If pytest is not installed in your environment and you want to use it, you can install it: with the tool pip. Your instructor should have shown you how in class, but if they did not, then you can install it from the terminal window with the command To write a pytest test case, we write a function whose name starts with the prefix as in the example code shown here. We wrote the test function inci). and now we write a function to test it. Here we test it with a typical value, and we call the function test_inc. def inc(x)= return x+1 def testinc(): assert inc(3)==4 1. Dessert Shop Part 1 Inside the test function in the example, we put an assert that evaluates a Booolean expression that is True if our code is correct, and will fail with an exception if our code is wrong. On the right-hand-side of the boolean expression you should put the expected value for our function call if it's working correctly. Two other things to keep in mind here: 1. We can write a collection of test functions like this one that test different attributes or results. Be sure to give each test function a unique name. In our case, our test functions go in 2. Inside each test function, you can create an object, test it, initialize it and modify it, or put any code you need to to set up a test with an assertion. For example, we could create a Cookie object and then test it's attributes with one or more assertions after the constructor. Why use a tool like pytest or unittest? Because it gives you a pattem for structuring your tests, it automates testing, it gives you a nice test report, and it provides additional functions that make more complex testing easier to write and maintain. Reading attribute values 1. Call the constructor with default values 2. Test each attribute for its expected default value 3. Call the constructor with non-default values 4. Test each attribute for its expected value Modifying attribute values 1. Call the constructor with default values 2. Modify an attribute 3. Test the attribute to see that it has its new value 1. Dessert Shop Part 1 Modifying attribute values 1. Call the constructor with default values 2. Modify an attribute 3. Test the attribute to see that it has its new value 4. Repeat steps 2 and 3 for each attribute 5. Call the constructor with non-default values 6. Modify an attribute 7. Test the attribute to see that it has its new value 8. Repeat steps 6 and 7 for each attribute Grading Even though you have written test cases to evaluate your code, it is still manually graded in part. Rubric All classes are implemented according to the description. All test cases are implemented correctly All test cases pass The dessert classes are in file desserts.py The test code is in file test desserts.py The test code is run with command python m pytest test_dessert.py or an