예제 #1
0
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))
예제 #2
0
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')
예제 #3
0
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')
예제 #4
0
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))
예제 #5
0
 def _get_new_surebets():
     sample = try_load(load_events, name, session=self.session)
     return try_parse(parse, sample, name)
예제 #6
0
 def _load_events():
     sample = try_load(load_events, name)
     try_parse(parse, sample, name, bookmaker=bookmaker)
     convert_olimp(bookmaker)
예제 #7
0
 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)