)]}'
{"oslo_vmware/tests/test_service.py":[{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"5ffcb0967cc846b3d9e1ab99ec4127ee6ee0d929","unresolved":false,"context_lines":[{"line_number":395,"context_line":"    def test_shared_cache(self):"},{"line_number":396,"context_line":"        cache1 \u003d service.Service().client.options.cache"},{"line_number":397,"context_line":"        cache2 \u003d service.Service().client.options.cache"},{"line_number":398,"context_line":"        self.assertIs(cache1, cache2)"},{"line_number":399,"context_line":""},{"line_number":400,"context_line":"    @mock.patch(\u0027oslo_utils.timeutils.utcnow_ts\u0027)"},{"line_number":401,"context_line":"    def test_cache_timeout(self, mock_utcnow_ts):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3ac371cc_bcb99c7b","line":398,"updated":"2016-08-17 12:19:37.000000000","message":"For this test, we need two different instances of the client with a shared cache. I think now we end up using the same client.","commit_id":"5a3378984ae447889db7c9c8d5c3a49a3650cdce"},{"author":{"_account_id":13294,"name":"Javier Peña","email":"jpena@redhat.com","username":"jpena"},"change_message_id":"f263bd4c66ceec356357c34908f434d1a93a3c36","unresolved":false,"context_lines":[{"line_number":395,"context_line":"    def test_shared_cache(self):"},{"line_number":396,"context_line":"        cache1 \u003d service.Service().client.options.cache"},{"line_number":397,"context_line":"        cache2 \u003d service.Service().client.options.cache"},{"line_number":398,"context_line":"        self.assertIs(cache1, cache2)"},{"line_number":399,"context_line":""},{"line_number":400,"context_line":"    @mock.patch(\u0027oslo_utils.timeutils.utcnow_ts\u0027)"},{"line_number":401,"context_line":"    def test_cache_timeout(self, mock_utcnow_ts):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3ac371cc_b2e37ca3","line":398,"in_reply_to":"3ac371cc_bcb99c7b","updated":"2016-08-17 14:22:21.000000000","message":"Mmm... I think you\u0027re right. The issue then is that we\u0027d need to patch the __fetch method, which is the one substituting download. Do you know any way we could fix this?","commit_id":"5a3378984ae447889db7c9c8d5c3a49a3650cdce"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"0d0a2a30af6951e660dc6164a46d0337ad1c039f","unresolved":false,"context_lines":[{"line_number":386,"context_line":"        self.assertEqual(\u0027value2\u0027, cache.get(\u0027key2\u0027))"},{"line_number":387,"context_line":"        self.assertIsNone(cache.get(\u0027key3\u0027))"},{"line_number":388,"context_line":""},{"line_number":389,"context_line":"    @mock.patch(\u0027suds.reader.DocumentReader._DocumentReader__fetch\u0027,"},{"line_number":390,"context_line":"                create\u003dTrue)"},{"line_number":391,"context_line":"    @mock.patch(\u0027suds.reader.DocumentReader.download\u0027, create\u003dTrue)"},{"line_number":392,"context_line":"    def test_shared_cache(self, mock_reader, mock_fetch):"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a629dbe_1f886770","line":389,"updated":"2016-11-11 15:26:04.000000000","message":"Mocking private methods of another library is pretty icky.  This makes me think we\u0027re mocking at the wrong level - we should only mock the public interface to the library that we directly call.  That way they can do whatever they want with the implementation and it doesn\u0027t affect us (unless they break their public api).\n\nI will admit I\u0027m not familiar with this code, but is there a reason we can\u0027t do that?","commit_id":"3f76b644cb6c60d3f438044c7f94f5a14476bbd0"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"9788a3b32a7864026b98f994f502f37f76eb706c","unresolved":false,"context_lines":[{"line_number":386,"context_line":"        self.assertEqual(\u0027value2\u0027, cache.get(\u0027key2\u0027))"},{"line_number":387,"context_line":"        self.assertIsNone(cache.get(\u0027key3\u0027))"},{"line_number":388,"context_line":""},{"line_number":389,"context_line":"    @mock.patch(\u0027suds.reader.DocumentReader._DocumentReader__fetch\u0027,"},{"line_number":390,"context_line":"                create\u003dTrue)"},{"line_number":391,"context_line":"    @mock.patch(\u0027suds.reader.DocumentReader.download\u0027, create\u003dTrue)"},{"line_number":392,"context_line":"    def test_shared_cache(self, mock_reader, mock_fetch):"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba5201f7_2df21fd3","line":389,"in_reply_to":"9a629dbe_1f886770","updated":"2017-01-02 20:28:00.000000000","message":"I agree. Don\u0027t build tests so they depend on implementation details of code we don\u0027t own. Mock the public API instead.","commit_id":"3f76b644cb6c60d3f438044c7f94f5a14476bbd0"},{"author":{"_account_id":13294,"name":"Javier Peña","email":"jpena@redhat.com","username":"jpena"},"change_message_id":"ff71a7885a1aad2c91e92431b03d7fc9381ace2e","unresolved":false,"context_lines":[{"line_number":386,"context_line":"        self.assertEqual(\u0027value2\u0027, cache.get(\u0027key2\u0027))"},{"line_number":387,"context_line":"        self.assertIsNone(cache.get(\u0027key3\u0027))"},{"line_number":388,"context_line":""},{"line_number":389,"context_line":"    @mock.patch(\u0027suds.reader.DocumentReader._DocumentReader__fetch\u0027,"},{"line_number":390,"context_line":"                create\u003dTrue)"},{"line_number":391,"context_line":"    @mock.patch(\u0027suds.reader.DocumentReader.download\u0027, create\u003dTrue)"},{"line_number":392,"context_line":"    def test_shared_cache(self, mock_reader, mock_fetch):"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa31d9ce_ddb82be8","line":389,"in_reply_to":"ba5201f7_2df21fd3","updated":"2017-02-13 11:25:10.000000000","message":"Thanks for the reviews. I think I\u0027ve fixed it without mocking any private method.","commit_id":"3f76b644cb6c60d3f438044c7f94f5a14476bbd0"}]}
