From 72102063bffb4312a58751b74f7eec44dac3822b Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 8 Jun 2012 14:10:11 +0900 Subject: [PATCH] add failing lapse test --- tests/test_sched.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_sched.py b/tests/test_sched.py index 651db293f..20ba958e6 100644 --- a/tests/test_sched.py +++ b/tests/test_sched.py @@ -242,6 +242,17 @@ def test_learn_day(): assert ni(c, 2) == 86400 d.sched.answerCard(c, 2) assert c.queue == c.type == 2 + # if the lapse step is tomorrow, failing it should handle the counts + # correctly + c.due = 0 + c.flush() + d.reset() + assert d.sched.counts() == (0, 0, 1) + d.sched._cardConf(c)['lapse']['delays'] = [1440] + c = d.sched.getCard() + d.sched.answerCard(c, 1) + assert c.queue == 3 + assert d.sched.counts() == (0, 0, 0) def test_reviews(): d = getEmptyDeck()