def do_perform_test(self, caplog, sample, expected): thug = ThugAPI() thug.set_useragent('win7ie90') thug.disable_acropdf() thug.disable_shockwave_flash() thug.disable_javaplugin() thug.disable_silverlight() 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 assert matches >= len(expected)
def do_perform_test(self, caplog, sample, silverlight, expected): thug = ThugAPI() thug.set_useragent('win7ie90') thug.set_events('click,storage') thug.disable_cert_logging() thug.set_features_logging() if silverlight in ('disable', ): thug.disable_silverlight() 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 assert matches >= len(expected)