mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 23:12:21 -04:00
gn->deckn in test
Obtained by ``` sed -i "s/\bg1\b/deck1/g" pylib/tests/*py qt/tests/*py sed -i "s/\bg2\b/deck2/g" pylib/tests/*py qt/tests/*py ```
This commit is contained in:
parent
2c73dcb2e5
commit
1af59545bd
3 changed files with 12 additions and 12 deletions
|
@ -46,15 +46,15 @@ def test_basic():
|
||||||
def test_remove():
|
def test_remove():
|
||||||
col = getEmptyCol()
|
col = getEmptyCol()
|
||||||
# create a new col, and add a note/card to it
|
# create a new col, and add a note/card to it
|
||||||
g1 = col.decks.id("g1")
|
deck1 = col.decks.id("deck1")
|
||||||
note = col.newNote()
|
note = col.newNote()
|
||||||
note["Front"] = "1"
|
note["Front"] = "1"
|
||||||
note.model()["did"] = g1
|
note.model()["did"] = deck1
|
||||||
col.addNote(note)
|
col.addNote(note)
|
||||||
c = note.cards()[0]
|
c = note.cards()[0]
|
||||||
assert c.did == g1
|
assert c.did == deck1
|
||||||
assert col.cardCount() == 1
|
assert col.cardCount() == 1
|
||||||
col.decks.rem(g1)
|
col.decks.rem(deck1)
|
||||||
assert col.cardCount() == 0
|
assert col.cardCount() == 0
|
||||||
# if we try to get it, we get the default
|
# if we try to get it, we get the default
|
||||||
assert col.decks.name(c.did) == "[no deck]"
|
assert col.decks.name(c.did) == "[no deck]"
|
||||||
|
|
|
@ -81,16 +81,16 @@ def test_new():
|
||||||
def test_newLimits():
|
def test_newLimits():
|
||||||
col = getEmptyCol()
|
col = getEmptyCol()
|
||||||
# add some notes
|
# add some notes
|
||||||
g2 = col.decks.id("Default::foo")
|
deck2 = col.decks.id("Default::foo")
|
||||||
for i in range(30):
|
for i in range(30):
|
||||||
note = col.newNote()
|
note = col.newNote()
|
||||||
note["Front"] = str(i)
|
note["Front"] = str(i)
|
||||||
if i > 4:
|
if i > 4:
|
||||||
note.model()["did"] = g2
|
note.model()["did"] = deck2
|
||||||
col.addNote(note)
|
col.addNote(note)
|
||||||
# give the child deck a different configuration
|
# give the child deck a different configuration
|
||||||
c2 = col.decks.add_config_returning_id("new conf")
|
c2 = col.decks.add_config_returning_id("new conf")
|
||||||
col.decks.setConf(col.decks.get(g2), c2)
|
col.decks.setConf(col.decks.get(deck2), c2)
|
||||||
col.reset()
|
col.reset()
|
||||||
# both confs have defaulted to a limit of 20
|
# both confs have defaulted to a limit of 20
|
||||||
assert col.sched.newCount == 20
|
assert col.sched.newCount == 20
|
||||||
|
@ -104,7 +104,7 @@ def test_newLimits():
|
||||||
col.reset()
|
col.reset()
|
||||||
assert col.sched.newCount == 10
|
assert col.sched.newCount == 10
|
||||||
# if we limit child to 4, we should get 9
|
# if we limit child to 4, we should get 9
|
||||||
conf2 = col.decks.confForDid(g2)
|
conf2 = col.decks.confForDid(deck2)
|
||||||
conf2["new"]["perDay"] = 4
|
conf2["new"]["perDay"] = 4
|
||||||
col.decks.save(conf2)
|
col.decks.save(conf2)
|
||||||
col.reset()
|
col.reset()
|
||||||
|
|
|
@ -82,16 +82,16 @@ def test_new():
|
||||||
def test_newLimits():
|
def test_newLimits():
|
||||||
col = getEmptyCol()
|
col = getEmptyCol()
|
||||||
# add some notes
|
# add some notes
|
||||||
g2 = col.decks.id("Default::foo")
|
deck2 = col.decks.id("Default::foo")
|
||||||
for i in range(30):
|
for i in range(30):
|
||||||
note = col.newNote()
|
note = col.newNote()
|
||||||
note["Front"] = str(i)
|
note["Front"] = str(i)
|
||||||
if i > 4:
|
if i > 4:
|
||||||
note.model()["did"] = g2
|
note.model()["did"] = deck2
|
||||||
col.addNote(note)
|
col.addNote(note)
|
||||||
# give the child deck a different configuration
|
# give the child deck a different configuration
|
||||||
c2 = col.decks.add_config_returning_id("new conf")
|
c2 = col.decks.add_config_returning_id("new conf")
|
||||||
col.decks.setConf(col.decks.get(g2), c2)
|
col.decks.setConf(col.decks.get(deck2), c2)
|
||||||
col.reset()
|
col.reset()
|
||||||
# both confs have defaulted to a limit of 20
|
# both confs have defaulted to a limit of 20
|
||||||
assert col.sched.newCount == 20
|
assert col.sched.newCount == 20
|
||||||
|
@ -105,7 +105,7 @@ def test_newLimits():
|
||||||
col.reset()
|
col.reset()
|
||||||
assert col.sched.newCount == 10
|
assert col.sched.newCount == 10
|
||||||
# if we limit child to 4, we should get 9
|
# if we limit child to 4, we should get 9
|
||||||
conf2 = col.decks.confForDid(g2)
|
conf2 = col.decks.confForDid(deck2)
|
||||||
conf2["new"]["perDay"] = 4
|
conf2["new"]["perDay"] = 4
|
||||||
col.decks.save(conf2)
|
col.decks.save(conf2)
|
||||||
col.reset()
|
col.reset()
|
||||||
|
|
Loading…
Reference in a new issue