def test_samples(): for num in range(3): filename = abs_path(name, 'sample{}.html'.format(num)) html = read_html(filename) try_parse(parse, html, name) logging.info('PASS: sample{}'.format(num))
def test_known_result(name, known_result_in_file_extension): parse = import_module('surebet.parsing.' + name).parse known_result_in = read_sample(name, 'knownResultIn.' + known_result_in_file_extension) known_result_out = read_sample(name, 'knownResultOut.json') bookmaker = Bookmaker(name) try_parse(parse, known_result_in, name, bookmaker=bookmaker) bookmaker.format() assert obj_dumps(bookmaker) == json_dumps(known_result_out) logging.info('PASS: known result')
def test_known_result(): filename = abs_path(name, 'knownResultIn.html') html = read_html(filename) filename = abs_path(name, 'knownResultOut.json') known_result = read_json(filename) surebets = try_parse(parse, html, name) assert obj_dumps(surebets) == json_dumps(known_result) logging.info('PASS: known result')
def test_samples(name, samplefile_extension): parse = import_module('surebet.parsing.' + name).parse for num in range(3): sample = read_sample(name, 'sample{}.{}'.format(num, samplefile_extension)) try_parse(parse, sample, name, bookmaker=Bookmaker(name)) logging.info('PASS: sample{}'.format(num))
def _get_new_surebets(): sample = try_load(load_events, name, session=self.session) return try_parse(parse, sample, name)
def _load_events(): sample = try_load(load_events, name) try_parse(parse, sample, name, bookmaker=bookmaker) convert_olimp(bookmaker)
def _load_events(): sample = try_load(load_events, name, browser=self.selenium.browser) line = try_load(load_events_json, name) try_parse(parse, sample, name, bookmaker=bookmaker) try_parse(parse_json, line, name, bookmaker=bookmaker)