test and to use the word test in the class name this class must inherit from the class unittest testcase so python knows how to run the tests you write namestestcase contains single method that tests one aspect of get_formatted_name(we call this method test_first_last_name(because we're verifying that names with only first and last name are formatted correctly any method that starts with test_ will be run automatically when we run test_name_function py within this test methodwe call the function we want to test and store return value that we're interested in testing in this example we call get_formatted_name(with the arguments 'janisand 'joplin'and store the result in formatted_name at we use one of unittest' most useful featuresan assert method assert methods verify that result you received matches the result you expected to receive in this casebecause we know get_formatted_name(is supposed to return capitalizedproperly spaced full namewe expect the value in formatted_name to be janis joplin to check if this is truewe use unittest' assertequal(method and pass it formatted_name and 'janis joplinthe line self assertequal(formatted_name'janis joplin'says"compare the value in formatted_name to the string 'janis joplinif they are equal as expectedfine but if they don' matchlet me know!the line unittest main(tells python to run the tests in this file when we run test_name_function pywe get the following outputran test in ok the dot on the first line of output tells us that single test passed the next line tells us that python ran one testand it took less than seconds to run the final ok tells us that all unit tests in the test case passed this output indicates that the function get_formatted_name(will always work for names that have first and last name unless we modify the function when we modify get_formatted_name()we can run this test again if the test case passeswe know the function will still work for names like janis joplin failing test what does failing test look likelet' modify get_formatted_name(so it can handle middle namesbut we'll do so in way that breaks the function for names with just first and last namelike janis joplin