)]}'
{"glance/tests/unit/async_/flows/plugins/test_inject_image_metadata.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d65546b85a24e855a02866c56b2ba94b3ae88225","unresolved":true,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        with mock.patch.object(self.img_repo, \u0027get\u0027) as get_mock:"},{"line_number":87,"context_line":"            image \u003d mock.MagicMock(image_id\u003dself.image_id,"},{"line_number":88,"context_line":"                                   extra_properties\u003d{\"test\": \"abc\"})"},{"line_number":89,"context_line":"            get_mock.return_value \u003d image"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"            with mock.patch.object(self.img_repo, \u0027save\u0027) as save_mock:"}],"source_content_type":"text/x-python","patch_set":1,"id":"832aee57_e0b41cbd","side":"PARENT","line":88,"updated":"2021-02-09 20:30:17.000000000","message":"Note here that these were mocking the image in it\u0027s expected form, so the asserts would have worked even if you removed the actual call to execute(). We already have the image mocked in setUp() so no need for this anyway.","commit_id":"9cf5c1769cd05212d58211ee254fa9c95a65a605"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d65546b85a24e855a02866c56b2ba94b3ae88225","unresolved":true,"context_lines":[{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        inject_image_metadata.execute()"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"        with mock.patch.object(self.img_repo, \u0027get\u0027) as get_mock:"},{"line_number":109,"context_line":"            get_mock.assert_not_called()"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        with mock.patch.object(self.img_repo, \u0027save\u0027) as save_mock:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7238f53b_1bd7b390","side":"PARENT","line":108,"updated":"2021-02-09 20:30:17.000000000","message":"This mock happens after call execute() on L106, so of course it is not yet called. The code *does* call this, so unless the code is wrong, we should be asserting a call here.","commit_id":"9cf5c1769cd05212d58211ee254fa9c95a65a605"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d65546b85a24e855a02866c56b2ba94b3ae88225","unresolved":true,"context_lines":[{"line_number":122,"context_line":"        inject_image_metadata.execute()"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        with mock.patch.object(self.img_repo, \u0027get\u0027) as get_mock:"},{"line_number":125,"context_line":"            get_mock.assert_not_called()"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        with mock.patch.object(self.img_repo, \u0027save\u0027) as save_mock:"},{"line_number":128,"context_line":"            save_mock.assert_not_called()"}],"source_content_type":"text/x-python","patch_set":1,"id":"275ec750_62a38276","side":"PARENT","line":125,"updated":"2021-02-09 20:30:17.000000000","message":"Same here, although we were not expecting a call, so despite this asserting the right orientation, it\u0027s doing so on a mock that was created after execute() ran.","commit_id":"9cf5c1769cd05212d58211ee254fa9c95a65a605"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d65546b85a24e855a02866c56b2ba94b3ae88225","unresolved":true,"context_lines":[{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        inject_image_metadata.execute()"},{"line_number":89,"context_line":"        self.img_repo.get.assert_called_once_with(self.image_id)"},{"line_number":90,"context_line":"        self.img_repo.save.assert_called_once_with(self.image)"},{"line_number":91,"context_line":"        self.assertEqual({\"test\": \"abc\"}, self.image.extra_properties)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def test_inject_image_metadata_using_admin_user(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa92f926_11052ceb","line":90,"updated":"2021-02-09 20:30:17.000000000","message":"We already have the image repo mocked out, no need to re-mock the methods on the mock to assert them.","commit_id":"fb328ba07ba60791684382c8f9c79d8d56fc59aa"}]}
