)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"0b03ca5be43e42fb80be188335a8f7123e35f5ae","unresolved":false,"context_lines":[{"line_number":12,"context_line":"create_cgsnapshot and delete_cgsnapshot functions of ISCSI"},{"line_number":13,"context_line":"HPE Lefthand driver"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"A bug fixed in delete_cgsnapshot function of hpe_lefthand_iscsi file."},{"line_number":16,"context_line":"Error log message has wrong syntax of printing \u0027error\u0027 dictionary."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I1efcf202eaddb5f39b119f0ea1a09fbf8b504e5a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"7aa08908_9d78af91","line":15,"updated":"2016-06-04 06:03:50.000000000","message":"Normally we need to file a Cinder bug and mention the bug number in the commit message.","commit_id":"e03672017051f4e4e18155280c53340fa1ae48f5"},{"author":{"_account_id":21406,"name":"Vijay Ladani","email":"vijay.ladani@hpe.com","username":"vladani"},"change_message_id":"24cd05f673a71803958ad1719d34f927fb9bf603","unresolved":false,"context_lines":[{"line_number":12,"context_line":"create_cgsnapshot and delete_cgsnapshot functions of ISCSI"},{"line_number":13,"context_line":"HPE Lefthand driver"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"A bug fixed in delete_cgsnapshot function of hpe_lefthand_iscsi file."},{"line_number":16,"context_line":"Error log message has wrong syntax of printing \u0027error\u0027 dictionary."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I1efcf202eaddb5f39b119f0ea1a09fbf8b504e5a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"7aa08908_c7e6afe7","line":15,"in_reply_to":"7aa08908_9d78af91","updated":"2016-06-10 05:53:56.000000000","message":"Bug #1591040 filed for this change.","commit_id":"e03672017051f4e4e18155280c53340fa1ae48f5"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"d59d127d1e866f4d9ee09c2e3be710a89579d645","unresolved":false,"context_lines":[{"line_number":12,"context_line":"create_cgsnapshot and delete_cgsnapshot functions of ISCSI"},{"line_number":13,"context_line":"HPE Lefthand driver"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Bug #1591040 fixed in delete_cgsnapshot function of hpe_lefthand_iscsi file."},{"line_number":16,"context_line":"Error log message has wrong syntax of printing \u0027error\u0027 dictionary."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I1efcf202eaddb5f39b119f0ea1a09fbf8b504e5a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"7aa08908_004b7d2c","line":15,"updated":"2016-06-10 07:11:33.000000000","message":"Please revert this change and add line \"Closes-bug: #1591040\" above Change-id.\n\nSee https://wiki.openstack.org/wiki/GitCommitMessages#Including_external_references","commit_id":"0193365e0e93725fe0bb07694c6a146dde6a52bf"},{"author":{"_account_id":21406,"name":"Vijay Ladani","email":"vijay.ladani@hpe.com","username":"vladani"},"change_message_id":"5959cf71a55aadbcdfdcb85faabc06328f7f4261","unresolved":false,"context_lines":[{"line_number":12,"context_line":"create_cgsnapshot and delete_cgsnapshot functions of ISCSI"},{"line_number":13,"context_line":"HPE Lefthand driver"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Bug #1591040 fixed in delete_cgsnapshot function of hpe_lefthand_iscsi file."},{"line_number":16,"context_line":"Error log message has wrong syntax of printing \u0027error\u0027 dictionary."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I1efcf202eaddb5f39b119f0ea1a09fbf8b504e5a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"7aa08908_3bdb4e1d","line":15,"in_reply_to":"7aa08908_004b7d2c","updated":"2016-06-10 07:48:41.000000000","message":"Done","commit_id":"0193365e0e93725fe0bb07694c6a146dde6a52bf"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"227c3f7304fcb9e24b31218382eb85f244c8655a","unresolved":false,"context_lines":[{"line_number":12,"context_line":"create_cgsnapshot and delete_cgsnapshot functions of ISCSI"},{"line_number":13,"context_line":"HPE Lefthand driver"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Closes-bug: #1591040 fixed in delete_cgsnapshot function of hpe_lefthand_iscsi file."},{"line_number":16,"context_line":"Error log message has wrong syntax of printing \u0027error\u0027 dictionary."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I1efcf202eaddb5f39b119f0ea1a09fbf8b504e5a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"7aa08908_cc9d2bbd","line":18,"range":{"start_line":15,"start_character":0,"end_line":18,"end_character":52},"updated":"2016-06-10 09:33:45.000000000","message":"A bug fixed in delete_cgsnapshot function of hpe_lefthand_iscsi file. Error log message has wrong syntax of printing \u0027error\u0027 dictionary\n\n\nCloses-bug: #1591040\n\nChange-Id: I1efcf202eaddb5f39b119f0ea1a09fbf8b504e5a","commit_id":"b30e28814d78fa3923b0bab03a01414b63fb0dbc"},{"author":{"_account_id":21406,"name":"Vijay Ladani","email":"vijay.ladani@hpe.com","username":"vladani"},"change_message_id":"ed56d228ed605afa864b44340f264bb6660c1e1b","unresolved":false,"context_lines":[{"line_number":12,"context_line":"create_cgsnapshot and delete_cgsnapshot functions of ISCSI"},{"line_number":13,"context_line":"HPE Lefthand driver"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Closes-bug: #1591040 fixed in delete_cgsnapshot function of hpe_lefthand_iscsi file."},{"line_number":16,"context_line":"Error log message has wrong syntax of printing \u0027error\u0027 dictionary."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I1efcf202eaddb5f39b119f0ea1a09fbf8b504e5a"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"7aa08908_75f83a7d","line":18,"range":{"start_line":15,"start_character":0,"end_line":18,"end_character":52},"in_reply_to":"7aa08908_cc9d2bbd","updated":"2016-06-10 10:40:05.000000000","message":"Done","commit_id":"b30e28814d78fa3923b0bab03a01414b63fb0dbc"}],"cinder/tests/unit/test_hpelefthand.py":[{"author":{"_account_id":21309,"name":"Jay Mehta","email":"jay87.mehta@gmail.com","username":"Jay"},"change_message_id":"aee9bdf356f46127770967d055461a17eb418b37","unresolved":false,"context_lines":[{"line_number":267,"context_line":""},{"line_number":268,"context_line":"            # execute driver"},{"line_number":269,"context_line":"            self.driver.check_for_setup_error()"},{"line_number":270,"context_line":"            mock_client.assert_has_calls(expected)"},{"line_number":271,"context_line":""},{"line_number":272,"context_line":"    def test_create_volume(self):"},{"line_number":273,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_1d78c68e","line":270,"range":{"start_line":270,"start_character":12,"end_line":270,"end_character":50},"updated":"2016-05-19 19:50:56.000000000","message":"Check if warning (LOG.warning)message is logged.\nYou can do that by creating another mock object for logging.\n    with mock.patch.object(logging.LoggerAdapter, \u0027warning\u0027) as mock_log_warning:\n        self.driver.check_for_setup_error()\n        expected \u003d self.driver_startup_call_stack + [\n            mock.call.getApiVersion(),\n            mock.call.logout()]\n        mock_client.assert_has_calls(expected)\n        mock_log_warning.assert_called_once()","commit_id":"7c0b52621ff649bfd52ddafa3eb8963b8f950057"},{"author":{"_account_id":21406,"name":"Vijay Ladani","email":"vijay.ladani@hpe.com","username":"vladani"},"change_message_id":"9d737519c8574a3c111293663858f475926f71e5","unresolved":false,"context_lines":[{"line_number":267,"context_line":""},{"line_number":268,"context_line":"            # execute driver"},{"line_number":269,"context_line":"            self.driver.check_for_setup_error()"},{"line_number":270,"context_line":"            mock_client.assert_has_calls(expected)"},{"line_number":271,"context_line":""},{"line_number":272,"context_line":"    def test_create_volume(self):"},{"line_number":273,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bab6814e_4ed63df2","line":270,"range":{"start_line":270,"start_character":12,"end_line":270,"end_character":50},"in_reply_to":"bab6814e_1d78c68e","updated":"2016-05-25 07:28:01.000000000","message":"At this moment, check_for_setup_error does not get used/called anywhere in lefthand. Even if this function is used, our unit test does already get cover logging part. Also it doesn\u0027t make sense to raise assert for this particular logging because there are many other log statements available in driver code which are not checked with such mechanism.","commit_id":"7c0b52621ff649bfd52ddafa3eb8963b8f950057"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"cb56f4ffebce5878a4ed313b177505a19ba15c75","unresolved":false,"context_lines":[{"line_number":272,"context_line":""},{"line_number":273,"context_line":"    def test_get_version_string(self):"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"        # setup drive with default configuration"},{"line_number":276,"context_line":"        # and return the mock HTTP LeftHand client"},{"line_number":277,"context_line":"        mock_client \u003d self.setup_driver()"},{"line_number":278,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9abb7d3a_037430cd","line":275,"updated":"2016-06-02 22:11:55.000000000","message":"driver","commit_id":"ebee12e7ba06d2da9328c5e17e6c9d34eda9368b"},{"author":{"_account_id":21406,"name":"Vijay Ladani","email":"vijay.ladani@hpe.com","username":"vladani"},"change_message_id":"dfd1d2901f7991df221241f09838069537d3b493","unresolved":false,"context_lines":[{"line_number":272,"context_line":""},{"line_number":273,"context_line":"    def test_get_version_string(self):"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"        # setup drive with default configuration"},{"line_number":276,"context_line":"        # and return the mock HTTP LeftHand client"},{"line_number":277,"context_line":"        mock_client \u003d self.setup_driver()"},{"line_number":278,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7aa08908_602076b1","line":275,"in_reply_to":"9abb7d3a_037430cd","updated":"2016-06-10 11:07:50.000000000","message":"Done","commit_id":"ebee12e7ba06d2da9328c5e17e6c9d34eda9368b"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"cb56f4ffebce5878a4ed313b177505a19ba15c75","unresolved":false,"context_lines":[{"line_number":283,"context_line":"            # execute driver"},{"line_number":284,"context_line":"            ver_string \u003d self.driver.get_version_string()"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"            self.assertIn(\u00272.0.8\u0027, ver_string)"},{"line_number":287,"context_line":""},{"line_number":288,"context_line":"    def test_check_for_setup_error(self):"},{"line_number":289,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9abb7d3a_c65b562d","line":286,"updated":"2016-06-02 22:11:55.000000000","message":"if you are going this far to unit test a string function, then you should also ensure that the hpelefthandclient.get_version_string() is being called.\n\nAlso, the version that\u0027s in the fake client is 2.1.0 here\nhttps://github.com/openstack/cinder/blob/master/cinder/tests/unit/fake_hpe_lefthand_client.py\n\nYou shouldn\u0027t hard code this value, but pull it from the version of the client library itself.\n\nAlso the version of 2.0.8 is the driver.VERSION value.","commit_id":"ebee12e7ba06d2da9328c5e17e6c9d34eda9368b"},{"author":{"_account_id":21406,"name":"Vijay Ladani","email":"vijay.ladani@hpe.com","username":"vladani"},"change_message_id":"dfd1d2901f7991df221241f09838069537d3b493","unresolved":false,"context_lines":[{"line_number":283,"context_line":"            # execute driver"},{"line_number":284,"context_line":"            ver_string \u003d self.driver.get_version_string()"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"            self.assertIn(\u00272.0.8\u0027, ver_string)"},{"line_number":287,"context_line":""},{"line_number":288,"context_line":"    def test_check_for_setup_error(self):"},{"line_number":289,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7aa08908_a02a5e8e","line":286,"in_reply_to":"9abb7d3a_c65b562d","updated":"2016-06-10 11:07:50.000000000","message":"Done","commit_id":"ebee12e7ba06d2da9328c5e17e6c9d34eda9368b"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"cb56f4ffebce5878a4ed313b177505a19ba15c75","unresolved":false,"context_lines":[{"line_number":287,"context_line":""},{"line_number":288,"context_line":"    def test_check_for_setup_error(self):"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"        # setup drive with default configuration"},{"line_number":291,"context_line":"        # and return the mock HTTP LeftHand client"},{"line_number":292,"context_line":"        mock_client \u003d self.setup_driver()"},{"line_number":293,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9abb7d3a_83678024","line":290,"updated":"2016-06-02 22:11:55.000000000","message":"driver","commit_id":"ebee12e7ba06d2da9328c5e17e6c9d34eda9368b"},{"author":{"_account_id":21406,"name":"Vijay Ladani","email":"vijay.ladani@hpe.com","username":"vladani"},"change_message_id":"dfd1d2901f7991df221241f09838069537d3b493","unresolved":false,"context_lines":[{"line_number":287,"context_line":""},{"line_number":288,"context_line":"    def test_check_for_setup_error(self):"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"        # setup drive with default configuration"},{"line_number":291,"context_line":"        # and return the mock HTTP LeftHand client"},{"line_number":292,"context_line":"        mock_client \u003d self.setup_driver()"},{"line_number":293,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7aa08908_2015ce48","line":290,"in_reply_to":"9abb7d3a_83678024","updated":"2016-06-10 11:07:50.000000000","message":"Done","commit_id":"ebee12e7ba06d2da9328c5e17e6c9d34eda9368b"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"0b03ca5be43e42fb80be188335a8f7123e35f5ae","unresolved":false,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        self.setup_driver()"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":"    def test__login(self):"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        conf \u003d self.default_mock_conf()"},{"line_number":245,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_3daffbe4","line":242,"range":{"start_line":242,"start_character":8,"end_line":242,"end_character":19},"updated":"2016-06-04 06:03:50.000000000","message":"Is there any login() method? If not, rename this to test_loign (no need of that extra underscore).","commit_id":"e03672017051f4e4e18155280c53340fa1ae48f5"},{"author":{"_account_id":21406,"name":"Vijay Ladani","email":"vijay.ladani@hpe.com","username":"vladani"},"change_message_id":"24cd05f673a71803958ad1719d34f927fb9bf603","unresolved":false,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        self.setup_driver()"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":"    def test__login(self):"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        conf \u003d self.default_mock_conf()"},{"line_number":245,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_a72443af","line":242,"range":{"start_line":242,"start_character":8,"end_line":242,"end_character":19},"in_reply_to":"7aa08908_3daffbe4","updated":"2016-06-10 05:53:56.000000000","message":"Private function\u0027s unit test is written with double \u0027_\u0027. This file already has such unit test with the name of  \u0027test__create_replication_client\u0027. I followed the same pattern to make it consistent.","commit_id":"e03672017051f4e4e18155280c53340fa1ae48f5"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"bbd4e2df57fd73318570860c3943257fbaf8fd74","unresolved":false,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        self.setup_driver()"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":"    def test__login(self):"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        conf \u003d self.default_mock_conf()"},{"line_number":245,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_2069598c","line":242,"range":{"start_line":242,"start_character":8,"end_line":242,"end_character":19},"in_reply_to":"7aa08908_a72443af","updated":"2016-06-10 07:10:40.000000000","message":"I would normally avoid the extra underscore, but this should be OK.","commit_id":"e03672017051f4e4e18155280c53340fa1ae48f5"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"0b03ca5be43e42fb80be188335a8f7123e35f5ae","unresolved":false,"context_lines":[{"line_number":245,"context_line":""},{"line_number":246,"context_line":"        # setup drive with default configuration"},{"line_number":247,"context_line":"        # and return the mock HTTP LeftHand client"},{"line_number":248,"context_line":"        mock_client \u003d self.setup_driver(config\u003dconf)"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"        with mock.patch.object(hpe_lefthand_iscsi.HPELeftHandISCSIDriver,"},{"line_number":251,"context_line":"                               \u0027_create_client\u0027) as mock_do_setup:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_5db6473e","line":248,"updated":"2016-06-04 06:03:50.000000000","message":"This is repeated in other tests, we can move this to setUp().","commit_id":"e03672017051f4e4e18155280c53340fa1ae48f5"},{"author":{"_account_id":21406,"name":"Vijay Ladani","email":"vijay.ladani@hpe.com","username":"vladani"},"change_message_id":"24cd05f673a71803958ad1719d34f927fb9bf603","unresolved":false,"context_lines":[{"line_number":245,"context_line":""},{"line_number":246,"context_line":"        # setup drive with default configuration"},{"line_number":247,"context_line":"        # and return the mock HTTP LeftHand client"},{"line_number":248,"context_line":"        mock_client \u003d self.setup_driver(config\u003dconf)"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"        with mock.patch.object(hpe_lefthand_iscsi.HPELeftHandISCSIDriver,"},{"line_number":251,"context_line":"                               \u0027_create_client\u0027) as mock_do_setup:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_e7364be6","line":248,"in_reply_to":"7aa08908_5db6473e","updated":"2016-06-10 05:53:56.000000000","message":"Done","commit_id":"e03672017051f4e4e18155280c53340fa1ae48f5"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"0b03ca5be43e42fb80be188335a8f7123e35f5ae","unresolved":false,"context_lines":[{"line_number":247,"context_line":"        # and return the mock HTTP LeftHand client"},{"line_number":248,"context_line":"        mock_client \u003d self.setup_driver(config\u003dconf)"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"        with mock.patch.object(hpe_lefthand_iscsi.HPELeftHandISCSIDriver,"},{"line_number":251,"context_line":"                               \u0027_create_client\u0027) as mock_do_setup:"},{"line_number":252,"context_line":"            mock_do_setup.return_value \u003d mock_client"},{"line_number":253,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_7d906396","line":250,"updated":"2016-06-04 06:03:50.000000000","message":"Other test methods use decorators for mock, please declare a decorator for consistency.","commit_id":"e03672017051f4e4e18155280c53340fa1ae48f5"},{"author":{"_account_id":21406,"name":"Vijay Ladani","email":"vijay.ladani@hpe.com","username":"vladani"},"change_message_id":"b6ab882544cbb4346c545330ea7695dd80f45fae","unresolved":false,"context_lines":[{"line_number":247,"context_line":"        # and return the mock HTTP LeftHand client"},{"line_number":248,"context_line":"        mock_client \u003d self.setup_driver(config\u003dconf)"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"        with mock.patch.object(hpe_lefthand_iscsi.HPELeftHandISCSIDriver,"},{"line_number":251,"context_line":"                               \u0027_create_client\u0027) as mock_do_setup:"},{"line_number":252,"context_line":"            mock_do_setup.return_value \u003d mock_client"},{"line_number":253,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_5ba57ab3","line":250,"in_reply_to":"7aa08908_205f990f","updated":"2016-06-10 07:46:35.000000000","message":"\u0027with patch.object\u0027 and \u0027@mock.patch\u0027 both are decorators. @mock.patch used when you have additional argument to be passed in a function. Same pattern is followed at all places.","commit_id":"e03672017051f4e4e18155280c53340fa1ae48f5"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"bbd4e2df57fd73318570860c3943257fbaf8fd74","unresolved":false,"context_lines":[{"line_number":247,"context_line":"        # and return the mock HTTP LeftHand client"},{"line_number":248,"context_line":"        mock_client \u003d self.setup_driver(config\u003dconf)"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"        with mock.patch.object(hpe_lefthand_iscsi.HPELeftHandISCSIDriver,"},{"line_number":251,"context_line":"                               \u0027_create_client\u0027) as mock_do_setup:"},{"line_number":252,"context_line":"            mock_do_setup.return_value \u003d mock_client"},{"line_number":253,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_205f990f","line":250,"in_reply_to":"7aa08908_474bdf59","updated":"2016-06-10 07:10:40.000000000","message":"Please see lines 2237, 2342, 2390. I think we should be consistent the way we declare the mocks.","commit_id":"e03672017051f4e4e18155280c53340fa1ae48f5"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"891a9c1d1e6b1e4cdf61978069b9ac9516d23d0b","unresolved":false,"context_lines":[{"line_number":247,"context_line":"        # and return the mock HTTP LeftHand client"},{"line_number":248,"context_line":"        mock_client \u003d self.setup_driver(config\u003dconf)"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"        with mock.patch.object(hpe_lefthand_iscsi.HPELeftHandISCSIDriver,"},{"line_number":251,"context_line":"                               \u0027_create_client\u0027) as mock_do_setup:"},{"line_number":252,"context_line":"            mock_do_setup.return_value \u003d mock_client"},{"line_number":253,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_090f2589","line":250,"in_reply_to":"7aa08908_5ba57ab3","updated":"2016-06-10 09:30:53.000000000","message":"\u0027with mockpatch.object\u0027 is not a decorator. I\u0027m not saying that you shouldn\u0027t use patch as a context manager. Please be consistent.","commit_id":"e03672017051f4e4e18155280c53340fa1ae48f5"},{"author":{"_account_id":21406,"name":"Vijay Ladani","email":"vijay.ladani@hpe.com","username":"vladani"},"change_message_id":"24cd05f673a71803958ad1719d34f927fb9bf603","unresolved":false,"context_lines":[{"line_number":247,"context_line":"        # and return the mock HTTP LeftHand client"},{"line_number":248,"context_line":"        mock_client \u003d self.setup_driver(config\u003dconf)"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"        with mock.patch.object(hpe_lefthand_iscsi.HPELeftHandISCSIDriver,"},{"line_number":251,"context_line":"                               \u0027_create_client\u0027) as mock_do_setup:"},{"line_number":252,"context_line":"            mock_do_setup.return_value \u003d mock_client"},{"line_number":253,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_474bdf59","line":250,"in_reply_to":"7aa08908_7d906396","updated":"2016-06-10 05:53:56.000000000","message":"Decorators have not been used anywhere in this test file hence skipping to change it. If we use decorator at mentioned places, may need to replace that change in many other places as well.","commit_id":"e03672017051f4e4e18155280c53340fa1ae48f5"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"0b03ca5be43e42fb80be188335a8f7123e35f5ae","unresolved":false,"context_lines":[{"line_number":282,"context_line":""},{"line_number":283,"context_line":"            # execute driver"},{"line_number":284,"context_line":"            ver_string \u003d self.driver.get_version_string()"},{"line_number":285,"context_line":"            self.assertIn(self.driver.VERSION, ver_string)"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"    def test_check_for_setup_error(self):"},{"line_number":288,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_bde80b18","line":285,"updated":"2016-06-04 06:03:50.000000000","message":"self.assertEqual?","commit_id":"e03672017051f4e4e18155280c53340fa1ae48f5"},{"author":{"_account_id":21406,"name":"Vijay Ladani","email":"vijay.ladani@hpe.com","username":"vladani"},"change_message_id":"24cd05f673a71803958ad1719d34f927fb9bf603","unresolved":false,"context_lines":[{"line_number":282,"context_line":""},{"line_number":283,"context_line":"            # execute driver"},{"line_number":284,"context_line":"            ver_string \u003d self.driver.get_version_string()"},{"line_number":285,"context_line":"            self.assertIn(self.driver.VERSION, ver_string)"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"    def test_check_for_setup_error(self):"},{"line_number":288,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_67789b90","line":285,"in_reply_to":"7aa08908_bde80b18","updated":"2016-06-10 05:53:56.000000000","message":"Done","commit_id":"e03672017051f4e4e18155280c53340fa1ae48f5"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"0b03ca5be43e42fb80be188335a8f7123e35f5ae","unresolved":false,"context_lines":[{"line_number":293,"context_line":"        # test for latest version"},{"line_number":294,"context_line":"        mock_client.getApiVersion.return_value \u003d (\u00273.0.0\u0027)"},{"line_number":295,"context_line":""},{"line_number":296,"context_line":"        with mock.patch.object(hpe_lefthand_iscsi.HPELeftHandISCSIDriver,"},{"line_number":297,"context_line":"                               \u0027_create_client\u0027) as mock_do_setup:"},{"line_number":298,"context_line":"            mock_do_setup.return_value \u003d mock_client"},{"line_number":299,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_9dd42f48","line":296,"updated":"2016-06-04 06:03:50.000000000","message":"decorator?","commit_id":"e03672017051f4e4e18155280c53340fa1ae48f5"},{"author":{"_account_id":21406,"name":"Vijay Ladani","email":"vijay.ladani@hpe.com","username":"vladani"},"change_message_id":"24cd05f673a71803958ad1719d34f927fb9bf603","unresolved":false,"context_lines":[{"line_number":293,"context_line":"        # test for latest version"},{"line_number":294,"context_line":"        mock_client.getApiVersion.return_value \u003d (\u00273.0.0\u0027)"},{"line_number":295,"context_line":""},{"line_number":296,"context_line":"        with mock.patch.object(hpe_lefthand_iscsi.HPELeftHandISCSIDriver,"},{"line_number":297,"context_line":"                               \u0027_create_client\u0027) as mock_do_setup:"},{"line_number":298,"context_line":"            mock_do_setup.return_value \u003d mock_client"},{"line_number":299,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_a77283ab","line":296,"in_reply_to":"7aa08908_9dd42f48","updated":"2016-06-10 05:53:56.000000000","message":"No changes needed. As explained above.","commit_id":"e03672017051f4e4e18155280c53340fa1ae48f5"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"0b03ca5be43e42fb80be188335a8f7123e35f5ae","unresolved":false,"context_lines":[{"line_number":2401,"context_line":"            \u0027extra_specs\u0027: {"},{"line_number":2402,"context_line":"                \u0027replication_enabled\u0027: \u0027\u003cis\u003e True\u0027}}"},{"line_number":2403,"context_line":""},{"line_number":2404,"context_line":"        with mock.patch.object("},{"line_number":2405,"context_line":"                hpe_lefthand_iscsi.HPELeftHandISCSIDriver,"},{"line_number":2406,"context_line":"                \u0027_create_client\u0027) as mock_do_setup, \\"},{"line_number":2407,"context_line":"            mock.patch.object("}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_ddceb7b3","line":2404,"updated":"2016-06-04 06:03:50.000000000","message":"Please use decorators.","commit_id":"e03672017051f4e4e18155280c53340fa1ae48f5"},{"author":{"_account_id":21406,"name":"Vijay Ladani","email":"vijay.ladani@hpe.com","username":"vladani"},"change_message_id":"24cd05f673a71803958ad1719d34f927fb9bf603","unresolved":false,"context_lines":[{"line_number":2401,"context_line":"            \u0027extra_specs\u0027: {"},{"line_number":2402,"context_line":"                \u0027replication_enabled\u0027: \u0027\u003cis\u003e True\u0027}}"},{"line_number":2403,"context_line":""},{"line_number":2404,"context_line":"        with mock.patch.object("},{"line_number":2405,"context_line":"                hpe_lefthand_iscsi.HPELeftHandISCSIDriver,"},{"line_number":2406,"context_line":"                \u0027_create_client\u0027) as mock_do_setup, \\"},{"line_number":2407,"context_line":"            mock.patch.object("}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_0768b7b9","line":2404,"in_reply_to":"7aa08908_ddceb7b3","updated":"2016-06-10 05:53:56.000000000","message":"No changes needed. As explained above.","commit_id":"e03672017051f4e4e18155280c53340fa1ae48f5"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"0b03ca5be43e42fb80be188335a8f7123e35f5ae","unresolved":false,"context_lines":[{"line_number":2413,"context_line":"            # mock HTTPNotFound - client"},{"line_number":2414,"context_line":"            mock_client.stopRemoteSnapshotSchedule.side_effect \u003d \\"},{"line_number":2415,"context_line":"                hpeexceptions.HTTPNotFound()"},{"line_number":2416,"context_line":"            self.driver.failover_host("},{"line_number":2417,"context_line":"                context.get_admin_context(),"},{"line_number":2418,"context_line":"                [self.volume_replicated],"},{"line_number":2419,"context_line":"                REPLICATION_BACKEND_ID)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_7dbea300","line":2416,"updated":"2016-06-04 06:03:50.000000000","message":"What is the expectation? No exception raised? Please add a note.","commit_id":"e03672017051f4e4e18155280c53340fa1ae48f5"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"bbd4e2df57fd73318570860c3943257fbaf8fd74","unresolved":false,"context_lines":[{"line_number":2413,"context_line":"            # mock HTTPNotFound - client"},{"line_number":2414,"context_line":"            mock_client.stopRemoteSnapshotSchedule.side_effect \u003d \\"},{"line_number":2415,"context_line":"                hpeexceptions.HTTPNotFound()"},{"line_number":2416,"context_line":"            self.driver.failover_host("},{"line_number":2417,"context_line":"                context.get_admin_context(),"},{"line_number":2418,"context_line":"                [self.volume_replicated],"},{"line_number":2419,"context_line":"                REPLICATION_BACKEND_ID)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_80d2cd32","line":2416,"in_reply_to":"7aa08908_07af17e4","updated":"2016-06-10 07:10:40.000000000","message":"\u003eRaise exception for normal client on HTTPNotFound. \n\nThen why we are not using self.assertRaises(..)?\n\nThe expectation is not clear to me.","commit_id":"e03672017051f4e4e18155280c53340fa1ae48f5"},{"author":{"_account_id":21406,"name":"Vijay Ladani","email":"vijay.ladani@hpe.com","username":"vladani"},"change_message_id":"24cd05f673a71803958ad1719d34f927fb9bf603","unresolved":false,"context_lines":[{"line_number":2413,"context_line":"            # mock HTTPNotFound - client"},{"line_number":2414,"context_line":"            mock_client.stopRemoteSnapshotSchedule.side_effect \u003d \\"},{"line_number":2415,"context_line":"                hpeexceptions.HTTPNotFound()"},{"line_number":2416,"context_line":"            self.driver.failover_host("},{"line_number":2417,"context_line":"                context.get_admin_context(),"},{"line_number":2418,"context_line":"                [self.volume_replicated],"},{"line_number":2419,"context_line":"                REPLICATION_BACKEND_ID)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_07af17e4","line":2416,"in_reply_to":"7aa08908_7dbea300","updated":"2016-06-10 05:53:56.000000000","message":"Raise exception for normal client on HTTPNotFound. Used short comment. Followed same pattern as used other places in file.","commit_id":"e03672017051f4e4e18155280c53340fa1ae48f5"},{"author":{"_account_id":21406,"name":"Vijay Ladani","email":"vijay.ladani@hpe.com","username":"vladani"},"change_message_id":"b6ab882544cbb4346c545330ea7695dd80f45fae","unresolved":false,"context_lines":[{"line_number":2413,"context_line":"            # mock HTTPNotFound - client"},{"line_number":2414,"context_line":"            mock_client.stopRemoteSnapshotSchedule.side_effect \u003d \\"},{"line_number":2415,"context_line":"                hpeexceptions.HTTPNotFound()"},{"line_number":2416,"context_line":"            self.driver.failover_host("},{"line_number":2417,"context_line":"                context.get_admin_context(),"},{"line_number":2418,"context_line":"                [self.volume_replicated],"},{"line_number":2419,"context_line":"                REPLICATION_BACKEND_ID)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_bb561e04","line":2416,"in_reply_to":"7aa08908_80d2cd32","updated":"2016-06-10 07:46:35.000000000","message":"The purpose of writing this code is to fall in exception part of driver code. Driver code does not have raise statement so we can not use self.assertRaises here.","commit_id":"e03672017051f4e4e18155280c53340fa1ae48f5"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"891a9c1d1e6b1e4cdf61978069b9ac9516d23d0b","unresolved":false,"context_lines":[{"line_number":2413,"context_line":"            # mock HTTPNotFound - client"},{"line_number":2414,"context_line":"            mock_client.stopRemoteSnapshotSchedule.side_effect \u003d \\"},{"line_number":2415,"context_line":"                hpeexceptions.HTTPNotFound()"},{"line_number":2416,"context_line":"            self.driver.failover_host("},{"line_number":2417,"context_line":"                context.get_admin_context(),"},{"line_number":2418,"context_line":"                [self.volume_replicated],"},{"line_number":2419,"context_line":"                REPLICATION_BACKEND_ID)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_e9173952","line":2416,"in_reply_to":"7aa08908_bb561e04","updated":"2016-06-10 09:30:53.000000000","message":"So I guess the exception handler ignores it. This should be made clear with a comment, else the test expectation is difficult to understand.","commit_id":"e03672017051f4e4e18155280c53340fa1ae48f5"},{"author":{"_account_id":16917,"name":"Alex O\u0027Rourke","email":"alex.orourke@hpe.com","username":"aorourke"},"change_message_id":"f8b66beba8cf114816a13e1e215ecbc99f44267c","unresolved":false,"context_lines":[{"line_number":241,"context_line":""},{"line_number":242,"context_line":"    def test__login(self):"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        # setup drive with default configuration"},{"line_number":245,"context_line":"        # and return the mock HTTP LeftHand client"},{"line_number":246,"context_line":"        mock_client \u003d self.setup_driver()"},{"line_number":247,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_73eb1613","line":244,"range":{"start_line":244,"start_character":16,"end_line":244,"end_character":21},"updated":"2016-06-16 18:20:28.000000000","message":"driver","commit_id":"0db32b6e1e2013aaf205abe8eb6636c0cd5336d5"},{"author":{"_account_id":21406,"name":"Vijay Ladani","email":"vijay.ladani@hpe.com","username":"vladani"},"change_message_id":"3484efed5c4f20d5f69db884349bbf7ddb67ec3e","unresolved":false,"context_lines":[{"line_number":241,"context_line":""},{"line_number":242,"context_line":"    def test__login(self):"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        # setup drive with default configuration"},{"line_number":245,"context_line":"        # and return the mock HTTP LeftHand client"},{"line_number":246,"context_line":"        mock_client \u003d self.setup_driver()"},{"line_number":247,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_ad8fc72c","line":244,"range":{"start_line":244,"start_character":16,"end_line":244,"end_character":21},"in_reply_to":"7aa08908_73eb1613","updated":"2016-06-17 04:50:10.000000000","message":"Replaced word \u0027drive\u0027 with \u0027driver\u0027 for all instances in file.","commit_id":"0db32b6e1e2013aaf205abe8eb6636c0cd5336d5"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"321805661c562be3c2b531c8eac0ed8476370aab","unresolved":false,"context_lines":[{"line_number":255,"context_line":"            mock_client.assert_has_calls(expected)"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"            # mock HTTPNotFound"},{"line_number":258,"context_line":"            mock_client.login.side_effect \u003d\\"},{"line_number":259,"context_line":"                hpeexceptions.HTTPNotFound()"},{"line_number":260,"context_line":"            # ensure the raised exception is a cinder exception"},{"line_number":261,"context_line":"            self.assertRaises(exception.DriverNotInitialized,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_d3b3ea08","line":258,"updated":"2016-06-16 18:43:58.000000000","message":"Please use () instead of \\","commit_id":"0db32b6e1e2013aaf205abe8eb6636c0cd5336d5"},{"author":{"_account_id":16917,"name":"Alex O\u0027Rourke","email":"alex.orourke@hpe.com","username":"aorourke"},"change_message_id":"f8b66beba8cf114816a13e1e215ecbc99f44267c","unresolved":false,"context_lines":[{"line_number":255,"context_line":"            mock_client.assert_has_calls(expected)"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"            # mock HTTPNotFound"},{"line_number":258,"context_line":"            mock_client.login.side_effect \u003d\\"},{"line_number":259,"context_line":"                hpeexceptions.HTTPNotFound()"},{"line_number":260,"context_line":"            # ensure the raised exception is a cinder exception"},{"line_number":261,"context_line":"            self.assertRaises(exception.DriverNotInitialized,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_53b9ba2d","line":258,"range":{"start_line":258,"start_character":42,"end_line":258,"end_character":44},"updated":"2016-06-16 18:20:28.000000000","message":"use parentheses instead of back slashes. \n    mock_client.login.side_effect \u003d (\n        hpeexceptions.HTTPNotFound())\n\nDo this for all the below instances as well","commit_id":"0db32b6e1e2013aaf205abe8eb6636c0cd5336d5"},{"author":{"_account_id":21406,"name":"Vijay Ladani","email":"vijay.ladani@hpe.com","username":"vladani"},"change_message_id":"3484efed5c4f20d5f69db884349bbf7ddb67ec3e","unresolved":false,"context_lines":[{"line_number":255,"context_line":"            mock_client.assert_has_calls(expected)"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"            # mock HTTPNotFound"},{"line_number":258,"context_line":"            mock_client.login.side_effect \u003d\\"},{"line_number":259,"context_line":"                hpeexceptions.HTTPNotFound()"},{"line_number":260,"context_line":"            # ensure the raised exception is a cinder exception"},{"line_number":261,"context_line":"            self.assertRaises(exception.DriverNotInitialized,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_cde69315","line":258,"in_reply_to":"7aa08908_d3b3ea08","updated":"2016-06-17 04:50:10.000000000","message":"Done","commit_id":"0db32b6e1e2013aaf205abe8eb6636c0cd5336d5"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"321805661c562be3c2b531c8eac0ed8476370aab","unresolved":false,"context_lines":[{"line_number":262,"context_line":"                              self.driver._login)"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"            # mock other HTTP exception"},{"line_number":265,"context_line":"            mock_client.login.side_effect \u003d\\"},{"line_number":266,"context_line":"                hpeexceptions.HTTPServerError()"},{"line_number":267,"context_line":"            # ensure the raised exception is a cinder exception"},{"line_number":268,"context_line":"            self.assertRaises(exception.DriverNotInitialized,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_b3b61ef7","line":265,"updated":"2016-06-16 18:43:58.000000000","message":"Same","commit_id":"0db32b6e1e2013aaf205abe8eb6636c0cd5336d5"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"321805661c562be3c2b531c8eac0ed8476370aab","unresolved":false,"context_lines":[{"line_number":2162,"context_line":"            self.assertEqual(\u0027available\u0027, cgsnap[\u0027status\u0027])"},{"line_number":2163,"context_line":""},{"line_number":2164,"context_line":"            # mock HTTPServerError (array failure)"},{"line_number":2165,"context_line":"            mock_client.createSnapshotSet.side_effect \u003d\\"},{"line_number":2166,"context_line":"                hpeexceptions.HTTPServerError()"},{"line_number":2167,"context_line":"            # ensure the raised exception is a cinder exception"},{"line_number":2168,"context_line":"            self.assertRaises("}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_dedc9148","line":2165,"updated":"2016-06-16 18:43:58.000000000","message":"Same.","commit_id":"0db32b6e1e2013aaf205abe8eb6636c0cd5336d5"},{"author":{"_account_id":21406,"name":"Vijay Ladani","email":"vijay.ladani@hpe.com","username":"vladani"},"change_message_id":"3484efed5c4f20d5f69db884349bbf7ddb67ec3e","unresolved":false,"context_lines":[{"line_number":2162,"context_line":"            self.assertEqual(\u0027available\u0027, cgsnap[\u0027status\u0027])"},{"line_number":2163,"context_line":""},{"line_number":2164,"context_line":"            # mock HTTPServerError (array failure)"},{"line_number":2165,"context_line":"            mock_client.createSnapshotSet.side_effect \u003d\\"},{"line_number":2166,"context_line":"                hpeexceptions.HTTPServerError()"},{"line_number":2167,"context_line":"            # ensure the raised exception is a cinder exception"},{"line_number":2168,"context_line":"            self.assertRaises("}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_0d9ffb5f","line":2165,"in_reply_to":"7aa08908_dedc9148","updated":"2016-06-17 04:50:10.000000000","message":"Done","commit_id":"0db32b6e1e2013aaf205abe8eb6636c0cd5336d5"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"321805661c562be3c2b531c8eac0ed8476370aab","unresolved":false,"context_lines":[{"line_number":2171,"context_line":"                ctxt, cgsnapshot, expected_snaps)"},{"line_number":2172,"context_line":""},{"line_number":2173,"context_line":"            # mock HTTPServerError (array failure)"},{"line_number":2174,"context_line":"            mock_client.getVolumeByName.side_effect \u003d\\"},{"line_number":2175,"context_line":"                hpeexceptions.HTTPNotFound()"},{"line_number":2176,"context_line":"            # ensure the raised exception is a cinder exception"},{"line_number":2177,"context_line":"            self.assertRaises("}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_bedf0539","line":2174,"updated":"2016-06-16 18:43:58.000000000","message":"Same.","commit_id":"0db32b6e1e2013aaf205abe8eb6636c0cd5336d5"},{"author":{"_account_id":21406,"name":"Vijay Ladani","email":"vijay.ladani@hpe.com","username":"vladani"},"change_message_id":"3484efed5c4f20d5f69db884349bbf7ddb67ec3e","unresolved":false,"context_lines":[{"line_number":2171,"context_line":"                ctxt, cgsnapshot, expected_snaps)"},{"line_number":2172,"context_line":""},{"line_number":2173,"context_line":"            # mock HTTPServerError (array failure)"},{"line_number":2174,"context_line":"            mock_client.getVolumeByName.side_effect \u003d\\"},{"line_number":2175,"context_line":"                hpeexceptions.HTTPNotFound()"},{"line_number":2176,"context_line":"            # ensure the raised exception is a cinder exception"},{"line_number":2177,"context_line":"            self.assertRaises("}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_ed99cf7a","line":2174,"in_reply_to":"7aa08908_bedf0539","updated":"2016-06-17 04:50:10.000000000","message":"Done","commit_id":"0db32b6e1e2013aaf205abe8eb6636c0cd5336d5"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"321805661c562be3c2b531c8eac0ed8476370aab","unresolved":false,"context_lines":[{"line_number":2326,"context_line":"                expected)"},{"line_number":2327,"context_line":""},{"line_number":2328,"context_line":"            # mock HTTPNotFound (volume not found)"},{"line_number":2329,"context_line":"            mock_client.getVolumeByName.side_effect \u003d\\"},{"line_number":2330,"context_line":"                hpeexceptions.HTTPNotFound()"},{"line_number":2331,"context_line":"            # no exception should escape method"},{"line_number":2332,"context_line":"            self.driver.delete_volume(self.volume_replicated)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_1ece1983","line":2329,"updated":"2016-06-16 18:43:58.000000000","message":"Same.","commit_id":"0db32b6e1e2013aaf205abe8eb6636c0cd5336d5"},{"author":{"_account_id":21406,"name":"Vijay Ladani","email":"vijay.ladani@hpe.com","username":"vladani"},"change_message_id":"3484efed5c4f20d5f69db884349bbf7ddb67ec3e","unresolved":false,"context_lines":[{"line_number":2326,"context_line":"                expected)"},{"line_number":2327,"context_line":""},{"line_number":2328,"context_line":"            # mock HTTPNotFound (volume not found)"},{"line_number":2329,"context_line":"            mock_client.getVolumeByName.side_effect \u003d\\"},{"line_number":2330,"context_line":"                hpeexceptions.HTTPNotFound()"},{"line_number":2331,"context_line":"            # no exception should escape method"},{"line_number":2332,"context_line":"            self.driver.delete_volume(self.volume_replicated)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_4d874312","line":2329,"in_reply_to":"7aa08908_1ece1983","updated":"2016-06-17 04:50:10.000000000","message":"Done","commit_id":"0db32b6e1e2013aaf205abe8eb6636c0cd5336d5"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"321805661c562be3c2b531c8eac0ed8476370aab","unresolved":false,"context_lines":[{"line_number":2332,"context_line":"            self.driver.delete_volume(self.volume_replicated)"},{"line_number":2333,"context_line":""},{"line_number":2334,"context_line":"            # mock HTTPNotFound (remote snapshot not found)"},{"line_number":2335,"context_line":"            mock_client.deleteRemoteSnapshotSchedule.side_effect \u003d\\"},{"line_number":2336,"context_line":"                hpeexceptions.HTTPNotFound()"},{"line_number":2337,"context_line":"            # no exception should escape method"},{"line_number":2338,"context_line":"            self.driver.delete_volume(self.volume_replicated)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_5ec8a174","line":2335,"updated":"2016-06-16 18:43:58.000000000","message":"Same.","commit_id":"0db32b6e1e2013aaf205abe8eb6636c0cd5336d5"},{"author":{"_account_id":21406,"name":"Vijay Ladani","email":"vijay.ladani@hpe.com","username":"vladani"},"change_message_id":"3484efed5c4f20d5f69db884349bbf7ddb67ec3e","unresolved":false,"context_lines":[{"line_number":2332,"context_line":"            self.driver.delete_volume(self.volume_replicated)"},{"line_number":2333,"context_line":""},{"line_number":2334,"context_line":"            # mock HTTPNotFound (remote snapshot not found)"},{"line_number":2335,"context_line":"            mock_client.deleteRemoteSnapshotSchedule.side_effect \u003d\\"},{"line_number":2336,"context_line":"                hpeexceptions.HTTPNotFound()"},{"line_number":2337,"context_line":"            # no exception should escape method"},{"line_number":2338,"context_line":"            self.driver.delete_volume(self.volume_replicated)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_8d812bfe","line":2335,"in_reply_to":"7aa08908_5ec8a174","updated":"2016-06-17 04:50:10.000000000","message":"Done","commit_id":"0db32b6e1e2013aaf205abe8eb6636c0cd5336d5"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"ba60bd58445b374f8a92033bb9ba61fa29285377","unresolved":false,"context_lines":[{"line_number":2401,"context_line":""},{"line_number":2402,"context_line":"        with mock.patch.object("},{"line_number":2403,"context_line":"                hpe_lefthand_iscsi.HPELeftHandISCSIDriver,"},{"line_number":2404,"context_line":"                \u0027_create_client\u0027) as mock_do_setup, \\"},{"line_number":2405,"context_line":"            mock.patch.object("},{"line_number":2406,"context_line":"                hpe_lefthand_iscsi.HPELeftHandISCSIDriver,"},{"line_number":2407,"context_line":"                \u0027_create_replication_client\u0027) as mock_replication_client:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a9d85d2_566d8531","line":2404,"range":{"start_line":2404,"start_character":51,"end_line":2404,"end_character":53},"updated":"2016-06-19 16:28:03.000000000","message":"Can remove this as well if you use ()","commit_id":"1003fbf49ef8a60f5c00bc4bc2d00a017b98076a"},{"author":{"_account_id":21406,"name":"Vijay Ladani","email":"vijay.ladani@hpe.com","username":"vladani"},"change_message_id":"00b25db43fb27529695fedc7df7d05b0ce28efc3","unresolved":false,"context_lines":[{"line_number":2401,"context_line":""},{"line_number":2402,"context_line":"        with mock.patch.object("},{"line_number":2403,"context_line":"                hpe_lefthand_iscsi.HPELeftHandISCSIDriver,"},{"line_number":2404,"context_line":"                \u0027_create_client\u0027) as mock_do_setup, \\"},{"line_number":2405,"context_line":"            mock.patch.object("},{"line_number":2406,"context_line":"                hpe_lefthand_iscsi.HPELeftHandISCSIDriver,"},{"line_number":2407,"context_line":"                \u0027_create_replication_client\u0027) as mock_replication_client:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a9d85d2_9e525bdc","line":2404,"range":{"start_line":2404,"start_character":51,"end_line":2404,"end_character":53},"in_reply_to":"5a9d85d2_566d8531","updated":"2016-06-20 07:01:00.000000000","message":"It will give syntax error. How is it possible!","commit_id":"1003fbf49ef8a60f5c00bc4bc2d00a017b98076a"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"4ddb5ee43b142e0c6763cbfee01a4a48bc701e33","unresolved":false,"context_lines":[{"line_number":2401,"context_line":""},{"line_number":2402,"context_line":"        with mock.patch.object("},{"line_number":2403,"context_line":"                hpe_lefthand_iscsi.HPELeftHandISCSIDriver,"},{"line_number":2404,"context_line":"                \u0027_create_client\u0027) as mock_do_setup, \\"},{"line_number":2405,"context_line":"            mock.patch.object("},{"line_number":2406,"context_line":"                hpe_lefthand_iscsi.HPELeftHandISCSIDriver,"},{"line_number":2407,"context_line":"                \u0027_create_replication_client\u0027) as mock_replication_client:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a9d85d2_a41746ec","line":2404,"range":{"start_line":2404,"start_character":51,"end_line":2404,"end_character":53},"in_reply_to":"5a9d85d2_9e525bdc","updated":"2016-06-20 08:16:25.000000000","message":"You are right, but not if we use contextlib.nested. Unfortuantely, contextlib.nested is deprecated since 2.7.\n\nAlternatively, we can use:\n\nwith mock.patch.object(\n                hpe_lefthand_iscsi.HPELeftHandISCSIDriver,\n                \u0027_create_client\u0027) as mock_do_setup:\n            with mock.patch.object(\n                hpe_lefthand_iscsi.HPELeftHandISCSIDriver,\n                \u0027_create_replication_client\u0027) as mock_replication_client:","commit_id":"1003fbf49ef8a60f5c00bc4bc2d00a017b98076a"}]}
