示例#1
0
def test_checkerGames_reviewCompetition():
    log = Log('test.log')
    output = Log('test.csv')
    c = CheckerGames(log, output)
    c.reviewCompetition(1, 1980)
    # Re-open output in read mode
    output.file = open('test.csv', 'r')
    # Two games in the sample dataset for 1980
    assert output.file.readline() == '1,1980,2\n'
示例#2
0
def test_checkerGames_checkGames():
    log = Log('test.log')
    output = Log('test.csv')
    c = CheckerGames(log, output)
    c.checkGames()
    # Re-open output in read mode
    output.file = open('test.csv', 'r')
    # Default start year is 2012, but sample games are in 1980.
    # This is by design, to give a negative test.
    assert output.file.readline() == ''
示例#3
0
def checkGames(args):
    print('Checking game counts\n')

    # Start log
    log = Log('trapp-check-games.log')
    log.message('Started')

    # Output file
    output = Log('trapp-check-games.csv')

    c = CheckerGames(log, output)
    c.checkGames()

    output.end()

    log.end()