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:
Arthur Milchior 2020-07-17 05:23:33 +02:00
parent 2c73dcb2e5
commit 1af59545bd
3 changed files with 12 additions and 12 deletions

View File

@ -46,15 +46,15 @@ def test_basic():
def test_remove():
col = getEmptyCol()
# 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["Front"] = "1"
note.model()["did"] = g1
note.model()["did"] = deck1
col.addNote(note)
c = note.cards()[0]
assert c.did == g1
assert c.did == deck1
assert col.cardCount() == 1
col.decks.rem(g1)
col.decks.rem(deck1)
assert col.cardCount() == 0
# if we try to get it, we get the default
assert col.decks.name(c.did) == "[no deck]"

View File

@ -81,16 +81,16 @@ def test_new():
def test_newLimits():
col = getEmptyCol()
# add some notes
g2 = col.decks.id("Default::foo")
deck2 = col.decks.id("Default::foo")
for i in range(30):
note = col.newNote()
note["Front"] = str(i)
if i > 4:
note.model()["did"] = g2
note.model()["did"] = deck2
col.addNote(note)
# give the child deck a different configuration
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()
# both confs have defaulted to a limit of 20
assert col.sched.newCount == 20
@ -104,7 +104,7 @@ def test_newLimits():
col.reset()
assert col.sched.newCount == 10
# if we limit child to 4, we should get 9
conf2 = col.decks.confForDid(g2)
conf2 = col.decks.confForDid(deck2)
conf2["new"]["perDay"] = 4
col.decks.save(conf2)
col.reset()

View File

@ -82,16 +82,16 @@ def test_new():
def test_newLimits():
col = getEmptyCol()
# add some notes
g2 = col.decks.id("Default::foo")
deck2 = col.decks.id("Default::foo")
for i in range(30):
note = col.newNote()
note["Front"] = str(i)
if i > 4:
note.model()["did"] = g2
note.model()["did"] = deck2
col.addNote(note)
# give the child deck a different configuration
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()
# both confs have defaulted to a limit of 20
assert col.sched.newCount == 20
@ -105,7 +105,7 @@ def test_newLimits():
col.reset()
assert col.sched.newCount == 10
# if we limit child to 4, we should get 9
conf2 = col.decks.confForDid(g2)
conf2 = col.decks.confForDid(deck2)
conf2["new"]["perDay"] = 4
col.decks.save(conf2)
col.reset()