Ejemplo n.º 1
0
def test_validate_match_score_empty_corner():
    match = Match([None, 'ABC', 'DEF', 'GHI'])

    ok_score = {
        'ABC': 1,
        'DEF': 1,
        'GHI': 1,
    }

    errors = validate_match_score(ok_score, match)
    assert len(errors) == 0
Ejemplo n.º 2
0
def test_validate_match_score_missing_team():
    match = Match(['ABC', 'DEF', 'GHI', 'JKL'])

    bad_score = {
        'ABC': 1,
        'DEF': 1,
        'GHI': 1,
    }

    errors = validate_match_score(bad_score, match)
    assert len(errors) == 1
    error = '\n'.join(errors)

    assert 'missing from this match' in error
    assert 'JKL' in error
Ejemplo n.º 3
0
def test_validate_match_score_empty_corner_2():
    match = Match([None, 'ABC', 'DEF', 'GHI'])

    bad_score = {
        'ABC': 1,
        'DEF': 1,
        'GHI': 1,
        'NOP': 1,
    }

    errors = validate_match_score(bad_score, match)
    assert len(errors) == 1
    error = '\n'.join(errors)

    assert 'not scheduled in this match' in error
    assert 'NOP' in error
Ejemplo n.º 4
0
def test_validate_match_score_extra_team_2():
    match = Match(['ABC', 'DEF', 'GHI', 'JKL'])

    bad_score = {
        'ABC': 1,
        'DEF': 1,
        'GHI': 1,
        'JKL': 1,
        'NOP': 1,
    }

    errors = validate_match_score(bad_score, match)
    assert len(errors) == 1
    error = '\n'.join(errors)

    assert 'not scheduled in this match' in error
    assert 'NOP' in error
Ejemplo n.º 5
0
def test_validate_match_score_swapped_team():
    match = Match(['ABC', 'DEF', 'GHI', 'JKL'])

    bad_score = {
        'ABC': 1,
        'DEF': 1,
        'GHI': 1,
        'NOP': 1,
    }

    errors = validate_match_score(bad_score, match)
    assert len(errors) == 2
    error = '\n'.join(errors)

    assert 'not scheduled in this match' in error
    assert 'missing from this match' in error
    assert 'JKL' in error
    assert 'NOP' in error