mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
note rollover problem in unit tests
This commit is contained in:
parent
621ba0e1ac
commit
ec3850aab2
1 changed files with 6 additions and 1 deletions
|
@ -1,10 +1,15 @@
|
||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
|
|
||||||
import time, copy
|
import time, copy, sys
|
||||||
from tests.shared import getEmptyDeck
|
from tests.shared import getEmptyDeck
|
||||||
from anki.utils import intTime
|
from anki.utils import intTime
|
||||||
from anki.hooks import addHook
|
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):
|
def checkRevIvl(d, c, targetIvl):
|
||||||
min, max = d.sched._fuzzIvlRange(targetIvl)
|
min, max = d.sched._fuzzIvlRange(targetIvl)
|
||||||
return min <= c.ivl <= max
|
return min <= c.ivl <= max
|
||||||
|
|
Loading…
Reference in a new issue