I have a Python module that uses the argparse library. How do I write tests for that section of the code base?
show_version.py
import argparse
def main():
parser = argparse.ArgumentParser(add_help=False)
parser.add_argument('-j', required=True)
parser.add_argument('-e', required=True)
parser.add_argument('-h', required=True)
parser.add_argument('-g')
args = parser.parse_args()
try:
...
except Exception as e:
...
...
if __name__ == '__main__':
main()