Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def do_perform_test(self, caplog, sample, shockwave, expected):
thug = ThugAPI()
thug.set_useragent('win7ie90')
thug.set_events('click,storage')
thug.disable_cert_logging()
thug.set_features_logging()
if shockwave in ('disable', ):
thug.disable_shockwave_flash()
else:
thug.set_shockwave_flash(shockwave)
thug.log_init(sample)
thug.run_local(sample)
records = [r.message for r in caplog.records]
def do_perform_test(self, caplog, sample, expected):
thug = ThugAPI()
thug.set_useragent('winxpie60')
thug.set_events('click')
thug.set_connect_timeout(2)
thug.disable_cert_logging()
thug.set_features_logging()
thug.set_ssl_verify()
thug.log_init(sample)
thug.run_local(sample)
records = [r.message for r in caplog.records]
matches = 0
for e in expected:
for record in records:
def do_perform_test(self, caplog, sample, expected):
thug = ThugAPI()
thug.set_useragent('win7chrome49')
thug.set_events('click,storage')
thug.set_connect_timeout(2)
thug.disable_cert_logging()
thug.set_features_logging()
thug.set_ssl_verify()
thug.log_init(sample)
thug.run_local(sample)
records = [r.message for r in caplog.records]
matches = 0
for e in expected:
for record in records:
def do_perform_test(self, caplog, url, expected, type_ = "remote"):
thug = ThugAPI()
thug.set_useragent('win7ie90')
thug.set_features_logging()
thug.set_ssl_verify()
thug.log_init(url)
m = getattr(thug, "run_{}".format(type_))
m(url)
records = [r.message for r in caplog.records]
matches = 0
for e in expected:
for record in records:
if e in record:
def do_perform_test(self, caplog, sample, expected, nofetch = False):
xmlhttp = getattr(log, 'XMLHTTP', None)
if xmlhttp:
delattr(log, 'XMLHTTP')
thug = ThugAPI()
thug.set_useragent('win7ie90')
thug.set_events('click,storage')
thug.set_connect_timeout(2)
thug.disable_cert_logging()
thug.set_ssl_verify()
thug.set_features_logging()
if nofetch:
thug.set_no_fetch()
thug.log_init(sample)
thug.run_local(sample)
records = [r.message for r in caplog.records]
def do_perform_test(self, caplog, url, expected, type_ = "remote"):
thug = ThugAPI()
thug.set_useragent('win7ie90')
thug.disable_screenshot()
thug.enable_screenshot()
thug.set_file_logging()
thug.set_json_logging()
thug.set_ssl_verify()
thug.log_init(url)
m = getattr(thug, "run_{}".format(type_))
m(url)
records = [r.message for r in caplog.records]
matches = 0
def do_perform_test(self, caplog, sample, expected, events = '', useragent = 'win7ie90'):
thug = ThugAPI()
thug.set_useragent(useragent)
thug.set_events(events)
thug.disable_cert_logging()
thug.set_features_logging()
thug.log_init(sample)
thug.run_local(sample)
records = [r.message for r in caplog.records]
matches = 0
for e in expected:
for record in records:
if e in record:
matches += 1
def do_perform_test(self, caplog, sample):
thug = ThugAPI()
thug.log_init(sample)
thug.set_useragent('win7ie90')
thug.set_verbose()
thug.set_json_logging()
thug.reset_features_logging()
assert thug.get_features_logging() is False
thug.set_features_logging()
assert thug.get_features_logging() is True
thug.log_init(sample)
thug.run_local(sample)
thug.log_event()
def do_perform_test(self, caplog, sample, adobe, expected):
thug = ThugAPI()
thug.set_useragent('win7ie90')
thug.set_events('click,storage')
thug.disable_cert_logging()
thug.set_features_logging()
if adobe in ('disable', ):
thug.disable_acropdf()
else:
thug.set_acropdf_pdf(adobe)
thug.log_init(sample)
thug.run_local(sample)
records = [r.message for r in caplog.records]