Fix off-by-one errors in tests

This commit is contained in:
Keith Edmunds 2023-11-15 19:07:23 +00:00
parent 56087870f4
commit 3cbc69b11e

View File

@ -202,7 +202,7 @@ def test_insert_header_row_end(monkeypatch, session):
# Test against edit_role because display_role for headers is
# handled differently (sets up row span)
assert (
model.edit_role(model.rowCount(), playlistmodel.Col.NOTE.value, prd)
model.edit_role(model.rowCount() - 1, playlistmodel.Col.NOTE.value, prd)
== note_text
)
@ -222,7 +222,7 @@ def test_insert_header_row_middle(monkeypatch, session):
# Test against edit_role because display_role for headers is
# handled differently (sets up row span)
assert (
model.edit_role(model.rowCount(), playlistmodel.Col.NOTE.value, prd)
model.edit_role(model.rowCount() - 1, playlistmodel.Col.NOTE.value, prd)
== note_text
)