update unit test for leech change

This commit is contained in:
Damien Elmes 2020-06-09 14:11:46 +10:00
parent 1aaf1059b4
commit 1cb0ac3670
2 changed files with 3 additions and 18 deletions

View file

@ -3,7 +3,6 @@
import copy
import time
from anki import hooks
from anki.consts import *
from anki.lang import without_unicode_isolation
from anki.utils import intTime
@ -376,23 +375,6 @@ def test_reviews():
assert c.due == d.sched.today + c.ivl
# factor should have been increased
assert c.factor == 2650
# leech handling
##################################################
c = copy.copy(cardcopy)
c.lapses = 7
c.flush()
# steup hook
hooked = []
def onLeech(card):
hooked.append(1)
hooks.card_did_leech.append(onLeech)
d.sched.answerCard(c, 1)
assert hooked
assert c.queue == QUEUE_TYPE_SUSPENDED
c.load()
assert c.queue == QUEUE_TYPE_SUSPENDED
def test_button_spacing():

View file

@ -389,6 +389,9 @@ def test_reviews():
assert c.factor == 2650
# leech handling
##################################################
conf = d.decks.getConf(1)
conf["lapse"]["leechAction"] = LEECH_SUSPEND
d.decks.save(conf)
c = copy.copy(cardcopy)
c.lapses = 7
c.flush()