Skip to content

Commit a496f5b

Browse files
committed
Added test for new case
1 parent b2fbab5 commit a496f5b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/plugins/test_edit.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,25 @@ def test_single_title_edit_apply(self, mock_write):
176176
)
177177
assert list(self.album.items())[-1].title == "modified t\u00eftle 9"
178178

179+
def test_title_edit_keep_editing_then_apply(self, mock_write):
180+
"""Edit titles, keep editing once, then apply changes."""
181+
# First, choose "keep editing" so changes are reverted in memory but
182+
# kept in the YAML file; then choose "apply" to commit them.
183+
self.run_mocked_command(
184+
{"replacements": {"t\u00eftle": "modified t\u00eftle"}},
185+
# keep Editing, then Apply
186+
["e", "a"],
187+
)
188+
189+
# Writes should only happen once per track, when we finally apply.
190+
assert mock_write.call_count == self.TRACK_COUNT
191+
# All item titles (and mtimes) should now reflect the modified values.
192+
self.assertItemFieldsModified(
193+
self.album.items(),
194+
self.items_orig,
195+
["title", "mtime"],
196+
)
197+
179198
def test_noedit(self, mock_write):
180199
"""Do not edit anything."""
181200
# Do not edit anything.

0 commit comments

Comments
 (0)