Make getTime() take arbitrary datetime object for testing purposes

This commit is contained in:
Klaus-Uwe Mitterer 2017-02-21 22:32:27 +01:00
parent 4c98e587b1
commit aea2cec4c7

View file

@ -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