mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
38 lines
868 B
Python
38 lines
868 B
Python
# coding: utf-8
|
|
|
|
import time, copy, os
|
|
from tests.shared import assertException, getEmptyDeck
|
|
from anki.stdmodels import BasicModel
|
|
from anki.utils import stripHTML, intTime
|
|
from anki.hooks import addHook
|
|
|
|
def test_stats():
|
|
d = getEmptyDeck()
|
|
f = d.newFact()
|
|
f['Front'] = "foo"
|
|
d.addFact(f)
|
|
c = f.cards()[0]
|
|
# card stats
|
|
assert d.cardStats(c)
|
|
d.reset()
|
|
c = d.sched.getCard()
|
|
d.sched.answerCard(c, 3)
|
|
d.sched.answerCard(c, 2)
|
|
assert d.cardStats(c)
|
|
# deck stats
|
|
assert d.deckStats()
|
|
|
|
def test_graphs():
|
|
from anki import Deck
|
|
d = Deck(os.path.expanduser("~/test.anki"))
|
|
g = d.graphs()
|
|
assert g.dueGraph()
|
|
assert g.cumDueGraph()
|
|
assert g.ivlGraph()
|
|
assert g.easeGraph()
|
|
assert g.repsGraph()
|
|
assert g.timeGraph()
|
|
return
|
|
g.workDone()
|
|
g.timeSpent()
|
|
g.addedRecently()
|