def __init__(self, ids_or_urls=[], options={}): util.mkdir_p(self.test_cases_path()) if not os.path.isfile(http_client.certs_path()): msg = ("You seem to have deleted the file of certificates " "that shipped with this repo. It should exist " "at %s" % http_client.certs_path()) raise error.StripeError(msg) if ids_or_urls == []: util.logger.info('No test case supplied. Randomly choosing among defaults.') ids_or_urls = [SystemRandom().choice(self.DEFAULT_TEST_CASES)] self.test_cases = map(lambda token: TestCase(self, token), ids_or_urls) self.options = options headers = { 'User-Agent': 'Stripe TestHarness/%s' % (self.VERSION,), } self.http_client = http_client.new_default_http_client(headers=headers, verify_ssl_certs=True)
def __init__(self, options): self.client = http_client.new_default_http_client() self.dictionary_path = options['dictionary_path'] self.child_popens = [] super(Runner, self).__init__(options)