)]}'
{"cinder/tests/test_hds_iscsi.py":[{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"ac907ce52fd72223c55faf1b87d2fe2c90e19e6e","unresolved":false,"context_lines":[{"line_number":333,"context_line":""},{"line_number":334,"context_line":"        # Test exception when config file has parsing errors"},{"line_number":335,"context_line":"        m_access.return_value \u003d True"},{"line_number":336,"context_line":"        error_config_file \u003d self._create_conf_file(HNAS_WRONG_CONF1, \u0027.xml\u0027)"},{"line_number":337,"context_line":"        self.configuration.hds_hnas_iscsi_config_file \u003d error_config_file"},{"line_number":338,"context_line":"        self.assertRaises(exception.ConfigNotFound, iscsi._read_config,"},{"line_number":339,"context_line":"                          error_config_file)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_85c9e8ad","line":336,"updated":"2015-02-06 12:53:28.000000000","message":"I think use real file in such tests is not good idea, you are just check exception throw. Could you mocking related functions instead using real one?","commit_id":"2787c71eb3910d38f89fac0871c46ab1e9e58399"},{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"ec7263b0b26fd7770b248c7f2385fcddb47f311b","unresolved":false,"context_lines":[{"line_number":333,"context_line":""},{"line_number":334,"context_line":"        # Test exception when config file has parsing errors"},{"line_number":335,"context_line":"        m_access.return_value \u003d True"},{"line_number":336,"context_line":"        error_config_file \u003d self._create_conf_file(HNAS_WRONG_CONF1, \u0027.xml\u0027)"},{"line_number":337,"context_line":"        self.configuration.hds_hnas_iscsi_config_file \u003d error_config_file"},{"line_number":338,"context_line":"        self.assertRaises(exception.ConfigNotFound, iscsi._read_config,"},{"line_number":339,"context_line":"                          error_config_file)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_c0dd8ee1","line":336,"in_reply_to":"da86d52c_85c9e8ad","updated":"2015-02-06 15:32:22.000000000","message":"Hi Anton. The function _read_config is being tested for its capability of reading a file, so a file object is created and passed to that function. Did you mean that such capability should be mocked?","commit_id":"2787c71eb3910d38f89fac0871c46ab1e9e58399"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"688d66c5a717147a2d8dc847d3689eeb59a59d2f","unresolved":false,"context_lines":[{"line_number":333,"context_line":""},{"line_number":334,"context_line":"        # Test exception when config file has parsing errors"},{"line_number":335,"context_line":"        m_access.return_value \u003d True"},{"line_number":336,"context_line":"        error_config_file \u003d self._create_conf_file(HNAS_WRONG_CONF1, \u0027.xml\u0027)"},{"line_number":337,"context_line":"        self.configuration.hds_hnas_iscsi_config_file \u003d error_config_file"},{"line_number":338,"context_line":"        self.assertRaises(exception.ConfigNotFound, iscsi._read_config,"},{"line_number":339,"context_line":"                          error_config_file)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_14436baf","line":336,"in_reply_to":"da86d52c_85c9e8ad","updated":"2015-02-06 14:02:32.000000000","message":"Is this because they are testing parsing?  If they can do it without the file that is good, but not going to hold this up for that.","commit_id":"2787c71eb3910d38f89fac0871c46ab1e9e58399"},{"author":{"_account_id":170,"name":"Mike Perez","email":"thingee@gmail.com","username":"thingee"},"change_message_id":"504498d8aba672b45a5b4d150f4b00b4e9b3d2c0","unresolved":false,"context_lines":[{"line_number":337,"context_line":"        self.configuration.hds_hnas_iscsi_config_file \u003d error_config_file"},{"line_number":338,"context_line":"        self.assertRaises(exception.ConfigNotFound, iscsi._read_config,"},{"line_number":339,"context_line":"                          error_config_file)"},{"line_number":340,"context_line":"        os.remove(error_config_file)"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"        # Test no service exception"},{"line_number":343,"context_line":"        error_config_file \u003d self._create_conf_file(HNAS_WRONG_CONF2, \u0027.xml\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_090429c5","line":340,"updated":"2015-02-06 16:39:46.000000000","message":"If you\u0027re going to do this, it should be in a self.addCleanup. Otherwise if something fails, it\u0027s going to sit around.\n\nRegardless, don\u0027t do this. Use mock.","commit_id":"2787c71eb3910d38f89fac0871c46ab1e9e58399"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"88325ce85762a66e1a543930504116882d2a0358","unresolved":false,"context_lines":[{"line_number":337,"context_line":"        self.configuration.hds_hnas_iscsi_config_file \u003d error_config_file"},{"line_number":338,"context_line":"        self.assertRaises(exception.ConfigNotFound, iscsi._read_config,"},{"line_number":339,"context_line":"                          error_config_file)"},{"line_number":340,"context_line":"        os.remove(error_config_file)"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"        # Test no service exception"},{"line_number":343,"context_line":"        error_config_file \u003d self._create_conf_file(HNAS_WRONG_CONF2, \u0027.xml\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_85c0de2b","line":340,"in_reply_to":"da86d52c_090429c5","updated":"2015-02-08 23:40:21.000000000","message":"+1 for this.\nIn a current implementation, a lot of temp file will be exists after tests run","commit_id":"2787c71eb3910d38f89fac0871c46ab1e9e58399"},{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"264639e583747ada885c6c3b2ad2e7acb4e78dec","unresolved":false,"context_lines":[{"line_number":337,"context_line":"        self.configuration.hds_hnas_iscsi_config_file \u003d error_config_file"},{"line_number":338,"context_line":"        self.assertRaises(exception.ConfigNotFound, iscsi._read_config,"},{"line_number":339,"context_line":"                          error_config_file)"},{"line_number":340,"context_line":"        os.remove(error_config_file)"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"        # Test no service exception"},{"line_number":343,"context_line":"        error_config_file \u003d self._create_conf_file(HNAS_WRONG_CONF2, \u0027.xml\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_b3bd1e05","line":340,"in_reply_to":"da86d52c_090429c5","updated":"2015-02-09 11:56:22.000000000","message":"Thanks everyone for your inputs. I can mock all external function calls in _read_config without problems, except for one: \n\"root \u003d ETree.parse(xml_config_file).getroot()\". \nI see two options here:\n1 - Mock open, hasattr and read inside ElementTree.py\u0027s parse function to return the XML contents and build the root object.\n2 - Mock ETree.parse with a side effect throwing exception, and mock again with the happy path. For the happy path, call the above line of code in my test to build the root object with a file that I know it works, so the function being tested can follow from there.\n\nIs approach #2 ok to be accepted?","commit_id":"2787c71eb3910d38f89fac0871c46ab1e9e58399"},{"author":{"_account_id":170,"name":"Mike Perez","email":"thingee@gmail.com","username":"thingee"},"change_message_id":"65292157db0a44a856cc7f6ebb938fc39054299e","unresolved":false,"context_lines":[{"line_number":338,"context_line":"        self.assertRaises(exception.ConfigNotFound, iscsi._read_config,"},{"line_number":339,"context_line":"                          error_config_file)"},{"line_number":340,"context_line":"        os.remove(error_config_file)"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"        # Test no service exception"},{"line_number":343,"context_line":"        error_config_file \u003d self._create_conf_file(HNAS_WRONG_CONF2, \u0027.xml\u0027)"},{"line_number":344,"context_line":"        self.configuration.hds_hnas_iscsi_config_file \u003d error_config_file"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_b267abe9","line":341,"updated":"2015-02-10 06:22:20.000000000","message":"Mocking ETree is how you would do it. I have no idea what you\u0027re talking about happy path.","commit_id":"2787c71eb3910d38f89fac0871c46ab1e9e58399"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"9448b09923ddc5dee931194823f119be2295d5bb","unresolved":false,"context_lines":[{"line_number":333,"context_line":"        m_open.return_value \u003d StringIO(HNAS_WRONG_CONF1)"},{"line_number":334,"context_line":"        self.assertRaises(exception.ConfigNotFound, iscsi._read_config, \u0027\u0027)"},{"line_number":335,"context_line":""},{"line_number":336,"context_line":"        # Test exception when config file has parsing errors"},{"line_number":337,"context_line":"        m_open.return_value \u003d StringIO(HNAS_WRONG_CONF2)"},{"line_number":338,"context_line":"        self.configuration.hds_hnas_iscsi_config_file \u003d \u0027\u0027"},{"line_number":339,"context_line":"        self.assertRaises(exception.ParameterNotFound, iscsi._read_config, \u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_87241ec7","line":336,"updated":"2015-02-17 07:03:26.000000000","message":"I think you need to change this comment.","commit_id":"3582d86dff7406ff27fbf18046aaedce3432b6cb"},{"author":{"_account_id":13636,"name":"aarefiev","display_name":"Anton","email":"arefyevanton@gmail.com","username":"aarefiev"},"change_message_id":"81923873304cd4e5d526b2e223b275b98e3d211a","unresolved":false,"context_lines":[{"line_number":19,"context_line":"\"\"\""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"import os"},{"line_number":22,"context_line":"from StringIO import StringIO"},{"line_number":23,"context_line":"import tempfile"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"import mock"}],"source_content_type":"text/x-python","patch_set":3,"id":"da86d52c_64528814","line":22,"updated":"2015-02-18 14:06:53.000000000","message":"import only module \"import StringIO\", please, if you will do next patch","commit_id":"c60c47f3138e551355af8418543b064a40fc32f9"},{"author":{"_account_id":170,"name":"Mike Perez","email":"thingee@gmail.com","username":"thingee"},"change_message_id":"89b4518fb48c39f459af470ed3e0363ecaef2278","unresolved":false,"context_lines":[{"line_number":300,"context_line":"        self.backend \u003d SimulatedHnasBackend()"},{"line_number":301,"context_line":"        _factory_bend.return_value \u003d self.backend"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"        (handle, self.config_file) \u003d tempfile.mkstemp(\u0027.xml\u0027)"},{"line_number":304,"context_line":"        os.write(handle, HNASCONF)"},{"line_number":305,"context_line":"        os.close(handle)"},{"line_number":306,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"da86d52c_61cfbe7f","line":303,"updated":"2015-02-19 00:09:02.000000000","message":"This needs to be added to _clean()","commit_id":"c60c47f3138e551355af8418543b064a40fc32f9"},{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"5ca20dcc21a00868d4d63e8aff353db286e1fb15","unresolved":false,"context_lines":[{"line_number":300,"context_line":"        self.backend \u003d SimulatedHnasBackend()"},{"line_number":301,"context_line":"        _factory_bend.return_value \u003d self.backend"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"        (handle, self.config_file) \u003d tempfile.mkstemp(\u0027.xml\u0027)"},{"line_number":304,"context_line":"        os.write(handle, HNASCONF)"},{"line_number":305,"context_line":"        os.close(handle)"},{"line_number":306,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"da86d52c_f2b1b001","line":303,"in_reply_to":"da86d52c_61cfbe7f","updated":"2015-02-19 11:52:17.000000000","message":"Hi Mike. Could you please explain a little bit more? The temporary file is already being removed in _clean(): \"os.remove(self.config_file)\".","commit_id":"c60c47f3138e551355af8418543b064a40fc32f9"}],"cinder/tests/test_hds_nfs.py":[{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"88325ce85762a66e1a543930504116882d2a0358","unresolved":false,"context_lines":[{"line_number":187,"context_line":"        self.configuration.hds_hnas_nfs_config_file \u003d error_config_file"},{"line_number":188,"context_line":"        self.assertRaises(exception.ParameterNotFound, nfs._read_config,"},{"line_number":189,"context_line":"                          error_config_file)"},{"line_number":190,"context_line":"        os.remove(error_config_file)"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"    @mock.patch.object(nfs.HDSNFSDriver, \u0027_id_to_vol\u0027)"},{"line_number":193,"context_line":"    @mock.patch.object(nfs.HDSNFSDriver, \u0027_get_provider_location\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_a5dc021a","line":190,"updated":"2015-02-08 23:40:21.000000000","message":"The same comments,  as in test_hds_iscsi.py","commit_id":"2787c71eb3910d38f89fac0871c46ab1e9e58399"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"9448b09923ddc5dee931194823f119be2295d5bb","unresolved":false,"context_lines":[{"line_number":177,"context_line":"        m_open.return_value \u003d StringIO(HNAS_WRONG_CONF1)"},{"line_number":178,"context_line":"        self.assertRaises(exception.ConfigNotFound, nfs._read_config, \u0027\u0027)"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"        # Test exception when config file has parsing errors"},{"line_number":181,"context_line":"        m_open.return_value \u003d StringIO(HNAS_WRONG_CONF2)"},{"line_number":182,"context_line":"        self.configuration.hds_hnas_iscsi_config_file \u003d \u0027\u0027"},{"line_number":183,"context_line":"        self.assertRaises(exception.ParameterNotFound, nfs._read_config, \u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da86d52c_4744e673","line":180,"updated":"2015-02-17 07:03:26.000000000","message":"I think you need to change this comment.","commit_id":"3582d86dff7406ff27fbf18046aaedce3432b6cb"}]}
