# HG changeset patch # User Jeff Hammel # Date 1473463235 25200 # Node ID f3e18bcfb90bef962a8d4d30f16691ffef2e9e0a # Parent 26f27678ae32e8a463f84bfe38fdfcfaff9ab69f more stubbing diff -r 26f27678ae32 -r f3e18bcfb90b htest/httptest.py --- a/htest/httptest.py Fri Sep 09 16:15:58 2016 -0700 +++ b/htest/httptest.py Fri Sep 09 16:20:35 2016 -0700 @@ -2,32 +2,15 @@ # -*- coding: utf-8 -*- """ - +test HTTP connectivity """ # imports import argparse import os -import subprocess import sys import time -# python requirements -# (key, value) = (module, PyPI name) -requirements = () -for module, package in requirements: - try: - globals()[module] = __import__(module) - except ImportError: - # install requirement and try again - subprocess.check_call(['pip', 'install', package]) - args = [sys.executable] + sys.argv - os.execl(sys.executable, *args) - -# module globals -__all__ = ['main', 'Parser'] -here = os.path.dirname(os.path.realpath(__file__)) -string = (str, unicode) def ensure_dir(directory): """ensure a directory exists""" @@ -39,8 +22,9 @@ return directory -class Parser(argparse.ArgumentParser): +class HTTPTestParser(argparse.ArgumentParser): """CLI option parser""" + def __init__(self, **kwargs): kwargs.setdefault('formatter_class', argparse.RawTextHelpFormatter) kwargs.setdefault('description', __doc__)