)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8415,"name":"Denis M.","email":"lildee1991@gmail.com","username":"dmakogon"},"change_message_id":"145f94fc7250e2eedb9c0d24c44b399428d8f68b","unresolved":false,"context_lines":[{"line_number":11,"context_line":"of global_requirements."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: Ic030cc846d9e7d0c9077240b0fac90f4f66a5a42"},{"line_number":14,"context_line":"Implements-bp: remove-mockito"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"AAAAWH%2F%2BgUQ%3D","line":14,"updated":"2014-03-26 10:41:39.000000000","message":"Implements: blueprint remove-mockito","commit_id":"72c540a27a5b59d2b18c3e4b8787677387424ce4"}],"trove/tests/fakes/swift.py":[{"author":{"_account_id":5390,"name":"Steve Leon","username":"steve-leon","inactive":true},"change_message_id":"af5ebda6515fefd15c67e4e557b988426c98a348","unresolved":false,"context_lines":[{"line_number":258,"context_line":""},{"line_number":259,"context_line":"    def __init__(self):"},{"line_number":260,"context_line":"        self._connection \u003d swift_client.Connection()"},{"line_number":261,"context_line":"        # simulate getting an unknown container"},{"line_number":262,"context_line":"        self._containers \u003d {}"},{"line_number":263,"context_line":"        self._containers_list \u003d []"},{"line_number":264,"context_line":"        self._objects \u003d {}"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAWH%2F%2BKtE%3D","line":261,"updated":"2014-03-28 18:07:34.000000000","message":"If the code was deleted, can you delete the comment as well?","commit_id":"9403f67062f55b75034572940951fcf6a38cc3cd"},{"author":{"_account_id":5293,"name":"Nikhil","email":"SlickNik@gmail.com","username":"slicknik"},"change_message_id":"43dcea3b70aa84568c2660063e5c4f80561ba2dd","unresolved":false,"context_lines":[{"line_number":258,"context_line":""},{"line_number":259,"context_line":"    def __init__(self):"},{"line_number":260,"context_line":"        self._connection \u003d swift_client.Connection()"},{"line_number":261,"context_line":"        # simulate getting an unknown container"},{"line_number":262,"context_line":"        self._containers \u003d {}"},{"line_number":263,"context_line":"        self._containers_list \u003d []"},{"line_number":264,"context_line":"        self._objects \u003d {}"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAWH%2F%2BJ54%3D","line":261,"in_reply_to":"AAAAWH%2F%2BKtE%3D","updated":"2014-03-28 18:49:03.000000000","message":"Good catch, will remove the comment.","commit_id":"9403f67062f55b75034572940951fcf6a38cc3cd"},{"author":{"_account_id":5390,"name":"Steve Leon","username":"steve-leon","inactive":true},"change_message_id":"af5ebda6515fefd15c67e4e557b988426c98a348","unresolved":false,"context_lines":[{"line_number":471,"context_line":"                                                  http_status\u003d404)"},{"line_number":472,"context_line":"            else:"},{"line_number":473,"context_line":"                return None"},{"line_number":474,"context_line":""},{"line_number":475,"context_line":"        swift_client.Connection.delete_object \u003d MagicMock("},{"line_number":476,"context_line":"            side_effect\u003dside_effect_func)"},{"line_number":477,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAWH%2F%2BKqU%3D","line":474,"updated":"2014-03-28 18:07:34.000000000","message":"You forgot to add the test for get_object() :P\n\nwhen(swift_client.Connection).get_object(container, name).thenRaise(swiftclient.ClientException(\u0027Resource Not found\u0027, http_status\u003d404))","commit_id":"9403f67062f55b75034572940951fcf6a38cc3cd"},{"author":{"_account_id":5293,"name":"Nikhil","email":"SlickNik@gmail.com","username":"slicknik"},"change_message_id":"43dcea3b70aa84568c2660063e5c4f80561ba2dd","unresolved":false,"context_lines":[{"line_number":471,"context_line":"                                                  http_status\u003d404)"},{"line_number":472,"context_line":"            else:"},{"line_number":473,"context_line":"                return None"},{"line_number":474,"context_line":""},{"line_number":475,"context_line":"        swift_client.Connection.delete_object \u003d MagicMock("},{"line_number":476,"context_line":"            side_effect\u003dside_effect_func)"},{"line_number":477,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAWH%2F%2BJ28%3D","line":474,"in_reply_to":"AAAAWH%2F%2BKqU%3D","updated":"2014-03-28 18:49:03.000000000","message":"This mock isn\u0027t needed now, since the side_effect function that  swift_client.Connection.get_object is patched with (above) already takes care of returning the exception in case the object is not found. This doesn\u0027t remove any tests, just mock behavior is changed.","commit_id":"9403f67062f55b75034572940951fcf6a38cc3cd"}],"trove/tests/unittests/backup/test_backup_models.py":[{"author":{"_account_id":5390,"name":"Steve Leon","username":"steve-leon","inactive":true},"change_message_id":"af5ebda6515fefd15c67e4e557b988426c98a348","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def test_create(self):"},{"line_number":56,"context_line":"        instance \u003d MagicMock()"},{"line_number":57,"context_line":"        with patch.object(instance_models.BuiltInstance, \u0027load\u0027,"},{"line_number":58,"context_line":"                          return_value\u003dinstance):"},{"line_number":59,"context_line":"            instance.validate_can_perform_action \u003d MagicMock("},{"line_number":60,"context_line":"                return_value\u003dNone)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAWH%2F%2BKj8%3D","line":57,"updated":"2014-03-28 18:07:34.000000000","message":"Just curious, why do you have to use \u0027patch\u0027 instead of MagicMock? For example, why is this not:\n\ninstance_models.BuiltInstance \u003d MagicMock(return_value\u003dinstance )","commit_id":"9403f67062f55b75034572940951fcf6a38cc3cd"},{"author":{"_account_id":5293,"name":"Nikhil","email":"SlickNik@gmail.com","username":"slicknik"},"change_message_id":"43dcea3b70aa84568c2660063e5c4f80561ba2dd","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def test_create(self):"},{"line_number":56,"context_line":"        instance \u003d MagicMock()"},{"line_number":57,"context_line":"        with patch.object(instance_models.BuiltInstance, \u0027load\u0027,"},{"line_number":58,"context_line":"                          return_value\u003dinstance):"},{"line_number":59,"context_line":"            instance.validate_can_perform_action \u003d MagicMock("},{"line_number":60,"context_line":"                return_value\u003dNone)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAWH%2F%2BJ%2Bg%3D","line":57,"in_reply_to":"AAAAWH%2F%2BKj8%3D","updated":"2014-03-28 18:49:03.000000000","message":"Using patch with a context manager makes it so that you don\u0027t have to to \"unpatch\" the object after your tests have run. The __exit__ method of the context manager takes care of this for you, and restores the object being patched to its original value.\n\n\nSometimes the instance being patched is local, and you don\u0027t care about restoring it. In this case, you can just replace the necessary bits with Mock/MagicMock, and be on your merry way.","commit_id":"9403f67062f55b75034572940951fcf6a38cc3cd"}],"trove/tests/unittests/guestagent/test_dbaas.py":[{"author":{"_account_id":5390,"name":"Steve Leon","username":"steve-leon","inactive":true},"change_message_id":"af5ebda6515fefd15c67e4e557b988426c98a348","unresolved":false,"context_lines":[{"line_number":673,"context_line":"        super(MySqlAppInstallTest, self).setUp()"},{"line_number":674,"context_line":"        self.orig_create_engine \u003d sqlalchemy.create_engine"},{"line_number":675,"context_line":"        self.orig_pkg_version \u003d dbaas.packager.pkg_version"},{"line_number":676,"context_line":"        self.orig_utils_execute_with_timeout \u003d utils.execute_with_timeout"},{"line_number":677,"context_line":""},{"line_number":678,"context_line":"    def tearDown(self):"},{"line_number":679,"context_line":"        super(MySqlAppInstallTest, self).tearDown()"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAWH%2F%2BKZo%3D","line":676,"updated":"2014-03-28 18:07:34.000000000","message":"Is this temp necessary?  Just wondering why it was passing before. And if it is needed, would it be better to use the \u0027with(patch.object)\u0027 so that it is only mocked within that context?","commit_id":"9403f67062f55b75034572940951fcf6a38cc3cd"},{"author":{"_account_id":5293,"name":"Nikhil","email":"SlickNik@gmail.com","username":"slicknik"},"change_message_id":"43dcea3b70aa84568c2660063e5c4f80561ba2dd","unresolved":false,"context_lines":[{"line_number":673,"context_line":"        super(MySqlAppInstallTest, self).setUp()"},{"line_number":674,"context_line":"        self.orig_create_engine \u003d sqlalchemy.create_engine"},{"line_number":675,"context_line":"        self.orig_pkg_version \u003d dbaas.packager.pkg_version"},{"line_number":676,"context_line":"        self.orig_utils_execute_with_timeout \u003d utils.execute_with_timeout"},{"line_number":677,"context_line":""},{"line_number":678,"context_line":"    def tearDown(self):"},{"line_number":679,"context_line":"        super(MySqlAppInstallTest, self).tearDown()"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAWH%2F%2BJ7o%3D","line":676,"in_reply_to":"AAAAWH%2F%2BKZo%3D","updated":"2014-03-28 18:49:03.000000000","message":"Yup, with(patch.object) only patches it with the context of that with statement. Tests were passing because it\u0027s likely that this is mocked _everywhere_, so the real implementation is not actually tested anywhere.   I noticed this and decided to plug the leak, so we\u0027re not leaking the Mock to another test.","commit_id":"9403f67062f55b75034572940951fcf6a38cc3cd"},{"author":{"_account_id":5390,"name":"Steve Leon","username":"steve-leon","inactive":true},"change_message_id":"af5ebda6515fefd15c67e4e557b988426c98a348","unresolved":false,"context_lines":[{"line_number":802,"context_line":""},{"line_number":803,"context_line":"    def setUp(self):"},{"line_number":804,"context_line":"        super(MySqlRootStatusTest, self).setUp()"},{"line_number":805,"context_line":"        self.orig_utils_execute_with_timeout \u003d utils.execute_with_timeout"},{"line_number":806,"context_line":""},{"line_number":807,"context_line":"    def tearDown(self):"},{"line_number":808,"context_line":"        super(MySqlRootStatusTest, self).tearDown()"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAWH%2F%2BKWU%3D","line":805,"updated":"2014-03-28 18:07:34.000000000","message":"Is this temp necessary? Because i dont see utils.execute_with_timeout being mocked anywhere in this class.","commit_id":"9403f67062f55b75034572940951fcf6a38cc3cd"},{"author":{"_account_id":5390,"name":"Steve Leon","username":"steve-leon","inactive":true},"change_message_id":"604c184d2fcb10c95c765a66010637fa2211ae9c","unresolved":false,"context_lines":[{"line_number":802,"context_line":""},{"line_number":803,"context_line":"    def setUp(self):"},{"line_number":804,"context_line":"        super(MySqlRootStatusTest, self).setUp()"},{"line_number":805,"context_line":"        self.orig_utils_execute_with_timeout \u003d utils.execute_with_timeout"},{"line_number":806,"context_line":""},{"line_number":807,"context_line":"    def tearDown(self):"},{"line_number":808,"context_line":"        super(MySqlRootStatusTest, self).tearDown()"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAWH%2F%2BJKY%3D","line":805,"in_reply_to":"AAAAWH%2F%2BJ60%3D","updated":"2014-03-28 20:19:34.000000000","message":"Ahh ok... So does it make sense to have this mocking on mock_sql_connection() instead of here? Maybe using with(patch.object) so that it stays within the context of the method","commit_id":"9403f67062f55b75034572940951fcf6a38cc3cd"},{"author":{"_account_id":5293,"name":"Nikhil","email":"SlickNik@gmail.com","username":"slicknik"},"change_message_id":"43dcea3b70aa84568c2660063e5c4f80561ba2dd","unresolved":false,"context_lines":[{"line_number":802,"context_line":""},{"line_number":803,"context_line":"    def setUp(self):"},{"line_number":804,"context_line":"        super(MySqlRootStatusTest, self).setUp()"},{"line_number":805,"context_line":"        self.orig_utils_execute_with_timeout \u003d utils.execute_with_timeout"},{"line_number":806,"context_line":""},{"line_number":807,"context_line":"    def tearDown(self):"},{"line_number":808,"context_line":"        super(MySqlRootStatusTest, self).tearDown()"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAWH%2F%2BJ60%3D","line":805,"in_reply_to":"AAAAWH%2F%2BKWU%3D","updated":"2014-03-28 18:49:03.000000000","message":"Yeah, it\u0027s necessary since it\u0027s mocked through the call to mock_sql_connection()","commit_id":"9403f67062f55b75034572940951fcf6a38cc3cd"}]}
