fix unit test, add ordinals to db

This commit is contained in:
Damien Elmes 2012-10-25 00:42:10 +09:00
parent 5c3f036936
commit bc896c21c9
2 changed files with 31 additions and 31 deletions

View file

@ -223,38 +223,38 @@ create table if not exists col (
); );
create table if not exists notes ( create table if not exists notes (
id integer primary key, id integer primary key, /* 0 */
guid text not null, guid text not null, /* 1 */
mid integer not null, mid integer not null, /* 2 */
mod integer not null, mod integer not null, /* 3 */
usn integer not null, usn integer not null, /* 4 */
tags text not null, tags text not null, /* 5 */
flds text not null, flds text not null, /* 6 */
sfld integer not null, sfld integer not null, /* 7 */
csum integer not null, csum integer not null, /* 8 */
flags integer not null, flags integer not null, /* 9 */
data text not null data text not null /* 10 */
); );
create table if not exists cards ( create table if not exists cards (
id integer primary key, id integer primary key, /* 0 */
nid integer not null, nid integer not null, /* 1 */
did integer not null, did integer not null, /* 2 */
ord integer not null, ord integer not null, /* 3 */
mod integer not null, mod integer not null, /* 4 */
usn integer not null, usn integer not null, /* 5 */
type integer not null, type integer not null, /* 6 */
queue integer not null, queue integer not null, /* 7 */
due integer not null, due integer not null, /* 8 */
ivl integer not null, ivl integer not null, /* 9 */
factor integer not null, factor integer not null, /* 10 */
reps integer not null, reps integer not null, /* 11 */
lapses integer not null, lapses integer not null, /* 12 */
left integer not null, left integer not null, /* 13 */
odue integer not null, odue integer not null, /* 14 */
odid integer not null, odid integer not null, /* 15 */
flags integer not null, flags integer not null, /* 16 */
data text not null data text not null /* 17 */
); );
create table if not exists revlog ( create table if not exists revlog (

View file

@ -146,11 +146,11 @@ def test_csv():
i.run() i.run()
# four problems - too many & too few fields, a missing front, and a # four problems - too many & too few fields, a missing front, and a
# duplicate entry # duplicate entry
assert len(i.log) == 6 assert len(i.log) == 5
assert i.total == 5 assert i.total == 5
# if we run the import again, it should update instead # if we run the import again, it should update instead
i.run() i.run()
assert len(i.log) == 6 assert len(i.log) == 5
assert i.total == 5 assert i.total == 5
# but importing should not clobber tags if they're unmapped # but importing should not clobber tags if they're unmapped
n = deck.getNote(deck.db.scalar("select id from notes")) n = deck.getNote(deck.db.scalar("select id from notes"))