Anki/tests/shared.py
Damien Elmes b0b4074cbd start work on learn mode, change models, more
- model config is now stored as a json-serialized dict, which allows us to
  quickly gather the info and allows for adding extra options more easily in
  the future
- denormalize modelId into the cards table, so we can get the model scheduling
  information without having to hit the facts table
- remove position - since we will handle spacing differently we don't need a
  separate variable to due to define sort order
- remove lastInterval from cards; the new cram mode and review early shouldn't
  need it
- successive->streak
- add new columns for learn mode
- move cram mode into new file; learn more and review early need more thought
- initial work on learn mode
- initial unit tests
2011-04-28 09:23:28 +09:00

15 lines
288 B
Python

import tempfile, os
from anki import Deck
def assertException(exception, func):
found = False
try:
func()
except exception:
found = True
assert found
def getDeck():
(fd, nam) = tempfile.mkstemp(suffix=".anki")
os.unlink(nam)
return Deck(nam)