Question: Please write a program in Python 3. Please Below is a code skeleton of a CLI program to test the functions in HW3.py In it,
Please write a program in Python 3. Please
Below is a code skeleton of a CLI program to test the functions in HW3.py In it, you will write test functions for each of the functions from the module HW3.py . Each test should verify that the function it is testing works correctly. If it does, then the test function should return True , else it should return False . Don't just use the tests from the interactive examples. Think about what the function is supposed to do, and make sure to test not only that, but what it might do in unusual circumstances. (*See note below) Use argparse to implement the CLI portion of the program so it works as shown below. Output from the program should look like this when you use the -h help flag: $ python HW3_test.py -h usage: HW3_test.py [-h] [-u] [-w] [-l] optional arguments: -h, --help show this help message and exit -u, --unique Flag to test the unique function from HW3 -w, --words Flag to test the words_containing function from HW3 -l, --len Flag to test the len_test function from HW3 If no arguments are given, the program should do nothing. Since there are only flags (ie, no string arguments as in the lecture examples), you will need to check the argparse documentation to see how to implement flag arguments. ######################################################## ###Program Example: import argparse from HW3 import words_containing, len_test, unique def test_unique(): """Return True/False if the test of unique passes/fails""" def test_words_containing(): """Return True/False if the test of words_containing passes/fails""" def test_len_test(): """Return True/False if the test of len_test passes/fails""" if __name__ == "__main__": parser = argparse.ArgumentParser() # Set up argparse information here # Based on user input, run test(s) requested and report outcome
show output.
##################################################################################
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
