Exemplo n.º 1
0
def test_importer_lookupTeamID(excel):
    log = Log('test.log')
    importer = Importer(excel, log)
    needle = 'Columbus Crew'
    assert importer.lookupTeamID(needle) == 1
    with pytest.raises(RuntimeError) as excinfo:
        needle = 'Columbus Magic'
        importer.lookupTeamID(needle)
    assert 'Team not found: ' in str(excinfo.value)
    with pytest.raises(RuntimeError) as excinfo:
        needle = 'Duplicate Sample Team'
        importer.lookupTeamID(needle)
    assert 'Ambiguous team name: ' in str(excinfo.value)