From 425b82e6e7788015174c9c7ad1952bfbb5042e16 Mon Sep 17 00:00:00 2001 From: Arthur Milchior Date: Fri, 17 Jul 2020 05:18:35 +0200 Subject: [PATCH] f2->note2 in test Obtained by ``` sed -i "s/\bf2\b/note2/g" pylib/tests/*py qt/tests/*py ``` --- pylib/tests/test_collection.py | 22 +++++++++++----------- pylib/tests/test_find.py | 26 +++++++++++++------------- pylib/tests/test_schedv1.py | 12 ++++++------ pylib/tests/test_schedv2.py | 18 +++++++++--------- 4 files changed, 39 insertions(+), 39 deletions(-) diff --git a/pylib/tests/test_collection.py b/pylib/tests/test_collection.py index 59a09ce43..141bdb5ee 100644 --- a/pylib/tests/test_collection.py +++ b/pylib/tests/test_collection.py @@ -74,13 +74,13 @@ def test_noteAddDelete(): # it should not be a duplicate assert not note.dupeOrEmpty() # now let's make a duplicate - f2 = deck.newNote() - f2["Front"] = "one" - f2["Back"] = "" - assert f2.dupeOrEmpty() + note2 = deck.newNote() + note2["Front"] = "one" + note2["Back"] = "" + assert note2.dupeOrEmpty() # empty first field should not be permitted either - f2["Front"] = " " - assert f2.dupeOrEmpty() + note2["Front"] = " " + assert note2.dupeOrEmpty() def test_fieldChecksum(): @@ -101,15 +101,15 @@ def test_addDelTags(): note = deck.newNote() note["Front"] = "1" deck.addNote(note) - f2 = deck.newNote() - f2["Front"] = "2" - deck.addNote(f2) + note2 = deck.newNote() + note2["Front"] = "2" + deck.addNote(note2) # adding for a given id deck.tags.bulkAdd([note.id], "foo") note.load() - f2.load() + note2.load() assert "foo" in note.tags - assert "foo" not in f2.tags + assert "foo" not in note2.tags # should be canonified deck.tags.bulkAdd([note.id], "foo aaa") note.load() diff --git a/pylib/tests/test_find.py b/pylib/tests/test_find.py index dbb387282..b75ce24cd 100644 --- a/pylib/tests/test_find.py +++ b/pylib/tests/test_find.py @@ -235,25 +235,25 @@ def test_findReplace(): note["Front"] = "foo" note["Back"] = "bar" deck.addNote(note) - f2 = deck.newNote() - f2["Front"] = "baz" - f2["Back"] = "foo" - deck.addNote(f2) - nids = [note.id, f2.id] + note2 = deck.newNote() + note2["Front"] = "baz" + note2["Back"] = "foo" + deck.addNote(note2) + nids = [note.id, note2.id] # should do nothing assert deck.findReplace(nids, "abc", "123") == 0 # global replace assert deck.findReplace(nids, "foo", "qux") == 2 note.load() assert note["Front"] == "qux" - f2.load() - assert f2["Back"] == "qux" + note2.load() + assert note2["Back"] == "qux" # single field replace assert deck.findReplace(nids, "qux", "foo", field="Front") == 1 note.load() assert note["Front"] == "foo" - f2.load() - assert f2["Back"] == "qux" + note2.load() + assert note2["Back"] == "qux" # regex replace assert deck.findReplace(nids, "B.r", "reg") == 0 note.load() @@ -269,10 +269,10 @@ def test_findDupes(): note["Front"] = "foo" note["Back"] = "bar" deck.addNote(note) - f2 = deck.newNote() - f2["Front"] = "baz" - f2["Back"] = "bar" - deck.addNote(f2) + note2 = deck.newNote() + note2["Front"] = "baz" + note2["Back"] = "bar" + deck.addNote(note2) f3 = deck.newNote() f3["Front"] = "quux" f3["Back"] = "bar" diff --git a/pylib/tests/test_schedv1.py b/pylib/tests/test_schedv1.py index 5e530fe34..ed5821baf 100644 --- a/pylib/tests/test_schedv1.py +++ b/pylib/tests/test_schedv1.py @@ -1051,10 +1051,10 @@ def test_reorder(): note = d.newNote() note["Front"] = "one" d.addNote(note) - f2 = d.newNote() - f2["Front"] = "two" - d.addNote(f2) - assert f2.cards()[0].due == 2 + note2 = d.newNote() + note2["Front"] = "two" + d.addNote(note2) + assert note2.cards()[0].due == 2 found = False # 50/50 chance of being reordered for i in range(20): @@ -1073,12 +1073,12 @@ def test_reorder(): f4["Front"] = "four" d.addNote(f4) assert note.cards()[0].due == 1 - assert f2.cards()[0].due == 2 + assert note2.cards()[0].due == 2 assert f3.cards()[0].due == 3 assert f4.cards()[0].due == 4 d.sched.sortCards([f3.cards()[0].id, f4.cards()[0].id], start=1, shift=True) assert note.cards()[0].due == 3 - assert f2.cards()[0].due == 4 + assert note2.cards()[0].due == 4 assert f3.cards()[0].due == 1 assert f4.cards()[0].due == 2 diff --git a/pylib/tests/test_schedv2.py b/pylib/tests/test_schedv2.py index b5017acfe..5124166d9 100644 --- a/pylib/tests/test_schedv2.py +++ b/pylib/tests/test_schedv2.py @@ -810,9 +810,9 @@ def test_preview(): d.addNote(note) c = note.cards()[0] orig = copy.copy(c) - f2 = d.newNote() - f2["Front"] = "two" - d.addNote(f2) + note2 = d.newNote() + note2["Front"] = "two" + d.addNote(note2) # cram deck did = d.decks.newDyn("Cram") cram = d.decks.get(did) @@ -1085,10 +1085,10 @@ def test_reorder(): note = d.newNote() note["Front"] = "one" d.addNote(note) - f2 = d.newNote() - f2["Front"] = "two" - d.addNote(f2) - assert f2.cards()[0].due == 2 + note2 = d.newNote() + note2["Front"] = "two" + d.addNote(note2) + assert note2.cards()[0].due == 2 found = False # 50/50 chance of being reordered for i in range(20): @@ -1107,12 +1107,12 @@ def test_reorder(): f4["Front"] = "four" d.addNote(f4) assert note.cards()[0].due == 1 - assert f2.cards()[0].due == 2 + assert note2.cards()[0].due == 2 assert f3.cards()[0].due == 3 assert f4.cards()[0].due == 4 d.sched.sortCards([f3.cards()[0].id, f4.cards()[0].id], start=1, shift=True) assert note.cards()[0].due == 3 - assert f2.cards()[0].due == 4 + assert note2.cards()[0].due == 4 assert f3.cards()[0].due == 1 assert f4.cards()[0].due == 2