From aea2cec4c7f948cbab7e82f93b563c5eb3050dd6 Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Tue, 21 Feb 2017 22:32:27 +0100 Subject: [PATCH] Make getTime() take arbitrary datetime object for testing purposes --- markov.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/markov.py b/markov.py index 2327013..00fde5e 100755 --- a/markov.py +++ b/markov.py @@ -36,9 +36,7 @@ def getText(db = dbtools.dbHelper()): def markovifyText(text): return Possy(text).make_short_sentence(130).replace("@", "@​") -def getTime(): - now = datetime.datetime.now() - +def getTime(now = datetime.datetime.now()): thenminute = 15 if now.minute < 15 else 30 if now.minute < 30 else 45 if now.minute < 45 else 0 thenhour = now.hour + 1 if thenminute == 0 else now.hour