Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_none_returns_requests(self):
utils.set_http_cache_session(self.make_cache())
utils.set_http_cache_session(None)
self.assertEquals(utils.get_http_session(), requests)
def setUp(self):
self.addCleanup(utils.set_http_cache_session, None)
def test_none_returns_requests(self):
utils.set_http_cache_session(self.make_cache())
utils.set_http_cache_session(None)
self.assertEquals(utils.get_http_session(), requests)
def setUp(self):
self.addCleanup(utils.set_http_cache_session, None)
default_good_date = "2009-01-01"
options = parse_args()
logger = commandline.setup_logging("mozregression", options, {"mach": sys.stdout})
fetch_config = create_config(options.app, mozinfo.os, options.bits)
if fetch_config.is_inbound():
# this can be useful for both inbound and nightly, because we
# can go to inbound from nightly.
fetch_config.set_inbound_branch(options.inbound_branch)
cacheSession = limitedfilecache.get_cache(
options.http_cache_dir, one_gigabyte,
logger=get_default_logger('Limited File Cache'))
set_http_cache_session(cacheSession)
if options.inbound:
if not fetch_config.is_inbound():
sys.exit('Unable to bissect inbound for `%s`' % fetch_config.app_name)
if not options.last_good_revision or not options.first_bad_revision:
sys.exit("If bisecting inbound, both --good-rev and --bad-rev"
" must be set")
bisector = Bisector(fetch_config, options,
last_good_revision=options.last_good_revision,
first_bad_revision=options.first_bad_revision)
return bisector.bisect_inbound
else:
# TODO: currently every fetch_config is nightly aware. Shoud we test
# for this to be sure here ?
fetch_config.set_nightly_repo(options.repo)
if not options.bad_release and not options.bad_date:
help="inbound branch name on ftp.mozilla.org",
metavar="[tracemonkey|mozilla-1.9.2]", default=None)
parser.add_option("--http-cache-dir", dest="http_cache_dir",
help="the directory for caching http requests")
options, args = parser.parse_args(args)
if not options.start_rev or not options.end_rev:
sys.exit("start revision and end revision must be specified")
fetch_config = create_config(options.app, options.os, options.bits)
cacheSession = limitedfilecache.get_cache(
options.http_cache_dir, one_gigabyte,
logger=get_default_logger('Limited File Cache'))
set_http_cache_session(cacheSession)
return BuildsFinder(fetch_config)