Question: submission template def myClass_demo_unit_test(inputClass): This example takes in a class definition as input, then instantiates a class object and test its method in a
submission template









def myClass_demo_unit_test(inputClass): """ This example takes in a class definition as input, then instantiates a class object and test its method in a try except system. # EL ET E || try: def example(): obj = inputClass() obj.demo () except ValueError as e: print('A ValueError was raised because + str(e)) # A class with one method class MyClass(): || || def __init__(self): || pass def demo(self): # test the demo method myClass_demo_unit_test (MyClass) 1 raise ValueError('Wrong input given!') Define function definitions here ====#
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
