From ec3850aab25a98319a5aa2fd69e94ad3f5ea85d1 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 2 Oct 2013 04:04:06 +0900 Subject: [PATCH] note rollover problem in unit tests --- tests/test_sched.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_sched.py b/tests/test_sched.py index 9876d5807..0f41d34d4 100644 --- a/tests/test_sched.py +++ b/tests/test_sched.py @@ -1,10 +1,15 @@ # coding: utf-8 -import time, copy +import time, copy, sys from tests.shared import getEmptyDeck from anki.utils import intTime from anki.hooks import addHook +def test_clock(): + d = getEmptyDeck() + if (d.sched.dayCutoff - intTime()) < 10*60: + raise Exception("Unit tests will fail around the day rollover.") + def checkRevIvl(d, c, targetIvl): min, max = d.sched._fuzzIvlRange(targetIvl) return min <= c.ivl <= max