Exemplo n.º 1
0
def test_euromil_grid_evaluate_grid_ok_results():
    """ grid_evaluate ok with results"""
    result = EuroResult(date(2018, 1, 1), [1, 2, 3, 4, 5], [1, 2])
    test_grid = Grid(list(range(1, 6)), list(range(1, 3)), star_plus=True)
    test_numbers, test_stars = test_grid.evaluate_grid(result)

    assert test_numbers == [1, 2, 3, 4, 5]
    assert test_stars == [1, 2]

    test_grid = Grid(list(range(5, 13)), list(range(2, 4)), star_plus=True)
    test_numbers, test_stars = test_grid.evaluate_grid(result)

    assert test_numbers == [5]
    assert test_stars == [2]
Exemplo n.º 2
0
def test_euromil_grid_evaluate_grid_ok_no_results():
    """ grid_evaluate ok without result"""
    result = EuroResult(date(2018, 1, 1), [1, 2, 3, 4, 5], [1, 2])
    test_grid = Grid(list(range(11, 16)), list(range(10, 13)), star_plus=False)

    test_numbers, test_stars = test_grid.evaluate_grid(result)

    assert test_numbers == []
    assert test_stars == []
Exemplo n.º 3
0
def test_euromil_grid_evaluate_grid_ko():
    """ grid_evaluate ko """
    with pytest.raises(ValueError):
        test_grid = Grid(list(range(1, 6)), list(range(1, 3)), star_plus=True)
        _, _ = test_grid.evaluate_grid("")