diff --git a/tests/test_checkminute.py b/tests/test_checkminute.py new file mode 100644 index 0000000..3387305 --- /dev/null +++ b/tests/test_checkminute.py @@ -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) diff --git a/trapp/check_minutes.py b/trapp/check_minutes.py new file mode 100644 index 0000000..1c26748 --- /dev/null +++ b/trapp/check_minutes.py @@ -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...') \ No newline at end of file diff --git a/trapp/command_line.py b/trapp/command_line.py index 0811acb..e1364da 100644 --- a/trapp/command_line.py +++ b/trapp/command_line.py @@ -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 @@ -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. @@ -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 @@ -273,6 +294,7 @@ def main(): 'verb', choices=['check-db', 'check-games', + 'check-minutes', 'compile-games', 'compile-teammates', 'compile-years',