From b903b44a0c733227cd284ce631231a0caa62d47e Mon Sep 17 00:00:00 2001 From: wordofglass Date: Tue, 22 Aug 2017 23:31:40 +0200 Subject: [PATCH] test_edit: Fix test that intended to change one item but affected two. This didn't manifest as a testing failure since the plugin (mostly silently) drops id changes. --- test/test_edit.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/test_edit.py b/test/test_edit.py index 8953ea2f1..0a6a286f5 100644 --- a/test/test_edit.py +++ b/test/test_edit.py @@ -210,13 +210,14 @@ class EditCommandTest(unittest.TestCase, TestHelper, EditMixin): def test_single_edit_add_field(self, mock_write): """Edit the yaml file appending an extra field to the first item, then apply changes.""" - # Append "foo: bar" to item with id == 1. - self.run_mocked_command({'replacements': {u"id: 1": - u"id: 1\nfoo: bar"}}, + # Append "foo: bar" to item with id == 2. ("id: 1" would match both + # "id: 1" and "id: 10") + self.run_mocked_command({'replacements': {u"id: 2": + u"id: 2\nfoo: bar"}}, # Apply changes. ['a']) - self.assertEqual(self.lib.items(u'id:1')[0].foo, 'bar') + self.assertEqual(self.lib.items(u'id:2')[0].foo, 'bar') # Even though a flexible attribute was written (which is not directly # written to the tags), write should still be called since templates # might use it.