mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Adjust pyblib test_find
This commit is contained in:
parent
8f01887fe7
commit
250b89be60
1 changed files with 4 additions and 2 deletions
|
@ -193,6 +193,7 @@ def test_findCards():
|
||||||
assert len(col.findCards("-prop:ease>2")) > 1
|
assert len(col.findCards("-prop:ease>2")) > 1
|
||||||
# recently failed
|
# recently failed
|
||||||
if not isNearCutoff():
|
if not isNearCutoff():
|
||||||
|
# rated
|
||||||
assert len(col.findCards("rated:1:1")) == 0
|
assert len(col.findCards("rated:1:1")) == 0
|
||||||
assert len(col.findCards("rated:1:2")) == 0
|
assert len(col.findCards("rated:1:2")) == 0
|
||||||
c = col.sched.getCard()
|
c = col.sched.getCard()
|
||||||
|
@ -204,13 +205,14 @@ def test_findCards():
|
||||||
assert len(col.findCards("rated:1:1")) == 1
|
assert len(col.findCards("rated:1:1")) == 1
|
||||||
assert len(col.findCards("rated:1:2")) == 1
|
assert len(col.findCards("rated:1:2")) == 1
|
||||||
assert len(col.findCards("rated:1")) == 2
|
assert len(col.findCards("rated:1")) == 2
|
||||||
assert len(col.findCards("rated:0:2")) == 0
|
|
||||||
assert len(col.findCards("rated:2:2")) == 1
|
assert len(col.findCards("rated:2:2")) == 1
|
||||||
|
assert len(col.findCards("rated:0")) == len(col.findCards("rated:1"))
|
||||||
|
|
||||||
# added
|
# added
|
||||||
assert len(col.findCards("added:0")) == 0
|
|
||||||
col.db.execute("update cards set id = id - 86400*1000 where id = ?", id)
|
col.db.execute("update cards set id = id - 86400*1000 where id = ?", id)
|
||||||
assert len(col.findCards("added:1")) == col.cardCount() - 1
|
assert len(col.findCards("added:1")) == col.cardCount() - 1
|
||||||
assert len(col.findCards("added:2")) == col.cardCount()
|
assert len(col.findCards("added:2")) == col.cardCount()
|
||||||
|
assert len(col.findCards("added:0")) == len(col.findCards("added:1"))
|
||||||
else:
|
else:
|
||||||
print("some find tests disabled near cutoff")
|
print("some find tests disabled near cutoff")
|
||||||
# empty field
|
# empty field
|
||||||
|
|
Loading…
Reference in a new issue