Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions tests/test_checkminute.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import pytest
from trapp.log import Log
from trapp.check_minutes import CheckerMinutes


def test_checkerGames_init():
log = Log('test.log')
output = Log('test.csv')
c = CheckerMinutes(log, output)
assert isinstance(c, CheckerMinutes)
9 changes: 9 additions & 0 deletions trapp/check_minutes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from trapp.checker import Checker


class CheckerMinutes(Checker):

def checkMinutes(self):
self.log.message('Starting work...')
22 changes: 22 additions & 0 deletions trapp/command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from trapp.database import Database
from trapp.log import Log
from trapp.check_games import CheckerGames
from trapp.check_minutes import CheckerMinutes
from trapp.compile_game import CompilerGames
from trapp.compile_teammate import CompilerTeammates
from trapp.import_game import ImporterGames
Expand Down Expand Up @@ -56,6 +57,24 @@ def checkGames(args):
log.end()


def checkMinutes(args):
print('Checking minute totals\n')

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

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

c = CheckerMinutes(log, output)
c.checkMinutes()

output.end()

log.end()


def compileGames():
# This is the compiler for game-level summary data
# This is the first compilation step.
Expand Down Expand Up @@ -200,6 +219,8 @@ def verbCheck(args):
checkDB(args)
elif (args.verb == 'check-games'):
checkGames(args)
elif (args.verb == 'check-minutes'):
checkMinutes(args)

return True

Expand Down Expand Up @@ -273,6 +294,7 @@ def main():
'verb',
choices=['check-db',
'check-games',
'check-minutes',
'compile-games',
'compile-teammates',
'compile-years',
Expand Down