)]}'
{"monasca_persister/tests/test_persister_repo.py":[{"author":{"_account_id":10311,"name":"Joseph Davis","email":"joseph.davis@suse.com","username":"joadavis"},"change_message_id":"628951a9ae75c8041a029ea797c9cce17f2ff3e7","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# (C) Copyright 2016 Hewlett Packard Enterprise Development Company LP"},{"line_number":2,"context_line":"# (C) Copyright 2017 SUSE LLC"},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":5,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":2,"id":"ffb9cba7_355f6c73","line":2,"updated":"2019-04-24 22:53:40.000000000","message":"You could add Fujitsu here if that is where you work. :)","commit_id":"65f106f06fddfa25fd47f6c7416fb625e6f519fd"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"038c24630bfc809c5f8db23f420369b6a9b5382e","unresolved":false,"context_lines":[{"line_number":85,"context_line":"    def test_flush_returns_if_data_points_is_none(self):"},{"line_number":86,"context_line":"        self.persister._data_points \u003d None"},{"line_number":87,"context_line":"        self.assertIsNone(self.persister._flush())"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def test_flush_calls_commit_once(self):"},{"line_number":90,"context_line":"        self.persister._data_points \u003d [\u0027some\u0027]"},{"line_number":91,"context_line":"        self.persister._flush()"},{"line_number":92,"context_line":"        self.mock_consumer_commit.assert_called_once_with()"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffb9cba7_1e4f8b34","line":89,"range":{"start_line":88,"start_character":0,"end_line":89,"end_character":43},"updated":"2019-05-01 14:12:17.000000000","message":"A general thought: Although this test works, what we really care about is that when the number of data points exceed or equal the batch size, they are written to the repo, and then commit is called.\n\nI think it is better to focus on writing tests which test the public methods, and exercise the internal implementation via the public methods.\n\nIn this case, we could call run(), use a mock to return a data point and then assert that write_batch and _consumer_commit are called? That would leave someone free to refactor the internal implementation without breaking all the units tests.","commit_id":"65f106f06fddfa25fd47f6c7416fb625e6f519fd"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"038c24630bfc809c5f8db23f420369b6a9b5382e","unresolved":false,"context_lines":[{"line_number":87,"context_line":"        self.assertIsNone(self.persister._flush())"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def test_flush_calls_commit_once(self):"},{"line_number":90,"context_line":"        self.persister._data_points \u003d [\u0027some\u0027]"},{"line_number":91,"context_line":"        self.persister._flush()"},{"line_number":92,"context_line":"        self.mock_consumer_commit.assert_called_once_with()"},{"line_number":93,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ffb9cba7_de66d3c1","line":90,"range":{"start_line":90,"start_character":8,"end_line":90,"end_character":12},"updated":"2019-05-01 14:12:17.000000000","message":"We could change batch_size to 2, and then check no commit is made for a single data point?","commit_id":"65f106f06fddfa25fd47f6c7416fb625e6f519fd"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"038c24630bfc809c5f8db23f420369b6a9b5382e","unresolved":false,"context_lines":[{"line_number":106,"context_line":"            self.persister.run()"},{"line_number":107,"context_line":"            self.mock_log_exception.assert_called()"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def test_flush_is_called_from_run_if_consumer_is_ok(self):"},{"line_number":110,"context_line":"        with patch.object(self.persister.repository, \u0027process_message\u0027,"},{"line_number":111,"context_line":"                          return_value\u003d\u0027message\u0027):"},{"line_number":112,"context_line":"            with patch.object(self.persister, \u0027_flush\u0027, return_value\u003dNone) as mock_flush:"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffb9cba7_de349395","line":109,"updated":"2019-05-01 14:12:17.000000000","message":"I think this test could be expanded so that it does the job of `test_flush_calls_commit_once`","commit_id":"65f106f06fddfa25fd47f6c7416fb625e6f519fd"},{"author":{"_account_id":17669,"name":"Doug Szumski","email":"doug@stackhpc.com","username":"DougSzumski"},"change_message_id":"038c24630bfc809c5f8db23f420369b6a9b5382e","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        exception_msgs \u003d [\u0027partial write: points beyond retention policy dropped\u0027,"},{"line_number":121,"context_line":"                          \u0027unable to parse points\u0027]"},{"line_number":122,"context_line":"        with(patch.object(LOG, \u0027info\u0027, side_effect\u003dexception)):"},{"line_number":123,"context_line":"            with(patch.object(cfg.CONF.repositories, \u0027ignore_parse_point_error\u0027,"},{"line_number":124,"context_line":"                              return_value\u003dTrue)):"},{"line_number":125,"context_line":"                for elem in exception_msgs:"},{"line_number":126,"context_line":"                    exception.message \u003d elem"}],"source_content_type":"text/x-python","patch_set":2,"id":"ffb9cba7_1ec46b5e","line":123,"range":{"start_line":123,"start_character":12,"end_line":123,"end_character":16},"updated":"2019-05-01 14:12:17.000000000","message":"What do you think about using the @mock.patch.object decorator to reduce nesting?","commit_id":"65f106f06fddfa25fd47f6c7416fb625e6f519fd"},{"author":{"_account_id":21922,"name":"Dobroslaw Zybort","email":"dobroslaw.zybort@ts.fujitsu.com","username":"dobrolaw.zybort"},"change_message_id":"49801614c707ec1a2e8a42abdc9943e37e168505","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# (C) Copyright 2019 Fujitsu Limited"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":5,"id":"bfb3d3c7_46be8eb4","line":1,"range":{"start_line":1,"start_character":0,"end_line":1,"end_character":36},"updated":"2019-05-29 11:56:36.000000000","message":"don\u0027t remove earlier licenses, add Fujitsu under them","commit_id":"7f2da27a3a0fa56672f25ee3ecd0ef90f0914e45"},{"author":{"_account_id":10311,"name":"Joseph Davis","email":"joseph.davis@suse.com","username":"joadavis"},"change_message_id":"fd8cb7aeee1b4fb3fd1e7c3762207b697b338e8b","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# (C) Copyright 2019 Fujitsu Limited"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":5,"id":"bfb3d3c7_4a9e8cb9","line":1,"range":{"start_line":1,"start_character":0,"end_line":1,"end_character":36},"in_reply_to":"bfb3d3c7_46be8eb4","updated":"2019-05-29 16:13:47.000000000","message":"Hmm, interesting point. As this is a new file, just one copyright is ok, but if it was derived from another test directly (which it looks like this was) then leaving the old copyrights may be more appropriate.","commit_id":"7f2da27a3a0fa56672f25ee3ecd0ef90f0914e45"},{"author":{"_account_id":30221,"name":"Arseni Lipinski","email":"arseni.lipinski@ts.fujitsu.com","username":"arseni.lipinski"},"change_message_id":"b1bcea85a18ade16b97e22698134f0846dd89246","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# (C) Copyright 2019 Fujitsu Limited"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":5,"id":"bfb3d3c7_e1c99a25","line":1,"range":{"start_line":1,"start_character":0,"end_line":1,"end_character":36},"in_reply_to":"bfb3d3c7_4a9e8cb9","updated":"2019-05-30 07:09:08.000000000","message":"this was a new file, the previous licences were just copied from repositories/persister.py as more of a template.","commit_id":"7f2da27a3a0fa56672f25ee3ecd0ef90f0914e45"}]}
