mirror of
https://github.com/beetbox/beets.git
synced 2026-01-04 06:53:27 +01:00
edit: add test for extra fields on user yaml
* Add test_invalid_yaml_extra_field, testing the handling of user appended fields (in particular, a non existing field) during the yaml editing.
This commit is contained in:
parent
5f2e5d73cc
commit
2adf70209f
1 changed files with 12 additions and 0 deletions
|
|
@ -239,6 +239,18 @@ class EditCommandTest(unittest.TestCase, TestHelper):
|
|||
self.assertCounts(write_call_count=0,
|
||||
title_starts_with=u't\u00eftle')
|
||||
|
||||
def test_invalid_yaml_extra_field(self):
|
||||
"""Edit the yaml file incorrectly (resulting in a well-formed but
|
||||
invalid yaml document), appending an extra field to the first item."""
|
||||
# append "foo: bar" to item with id == 1
|
||||
self.run_mocked_command({'replacements': {u'id: 1':
|
||||
u'id: 1\nfoo: bar'}},
|
||||
# no stdin
|
||||
[])
|
||||
|
||||
self.assertCounts(write_call_count=0,
|
||||
title_starts_with=u't\u00eftle')
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromName(__name__)
|
||||
|
|
|
|||
Loading…
Reference in a new issue