)]}'
{"swift/cli/recon.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"18eff2d26ab5e5fa5bc8c5f4a5a6a4126b51369e","unresolved":false,"context_lines":[{"line_number":256,"context_line":"                    md5sum.update(block)"},{"line_number":257,"context_line":"                    block \u003d f.read(4096)"},{"line_number":258,"context_line":"            ring_sum \u003d md5sum.hexdigest()"},{"line_number":259,"context_line":"            rings[ring_name] \u003d ring_sum"},{"line_number":260,"context_line":"        recon \u003d Scout(\"ringmd5\", self.verbose, self.suppress_errors,"},{"line_number":261,"context_line":"                      self.timeout)"},{"line_number":262,"context_line":"        print(\"[%s] Checking ring md5sums\" % self._ptime())"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a6eadb0_6b3c1c30","side":"PARENT","line":259,"updated":"2016-12-12 19:43:26.000000000","message":"yeah so duplicating a function between modules is one thing - but twice in the same file is probably worth fixing?  :\\","commit_id":"053b625f42e2d1d90e18ad72e16099a5b62447dd"}],"test/unit/common/middleware/test_recon.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"18eff2d26ab5e5fa5bc8c5f4a5a6a4126b51369e","unresolved":false,"context_lines":[{"line_number":363,"context_line":"                    \u0027%s/container.ring.gz\u0027 % self.tempdir: None,"},{"line_number":364,"context_line":"                    \u0027%s/object.ring.gz\u0027 % self.tempdir: None}"},{"line_number":365,"context_line":"        with mock.patch(\u0027swift.common.middleware.recon.md5_hash_for_file\u0027,"},{"line_number":366,"context_line":"                        side_effect\u003dIOError):"},{"line_number":367,"context_line":"            ringmd5 \u003d self.app.get_ring_md5()"},{"line_number":368,"context_line":"        self.assertEqual(sorted(ringmd5.items()),"},{"line_number":369,"context_line":"                         sorted(expt_out.items()))"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a6eadb0_0b99e86e","line":366,"updated":"2016-12-12 19:43:26.000000000","message":"The use of side_effect here (and the handfull of other places) is a pretty nice cleanup","commit_id":"609b5182c4282f8965cd6c04e5b2181d0ed08ef8"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"18eff2d26ab5e5fa5bc8c5f4a5a6a4126b51369e","unresolved":false,"context_lines":[{"line_number":373,"context_line":"        def fake_hash_for_file(fn):"},{"line_number":374,"context_line":"            if \u0027object\u0027 not in fn:"},{"line_number":375,"context_line":"                raise IOError"},{"line_number":376,"context_line":"            return \u0027hash-\u0027 + os.path.basename(fn)"},{"line_number":377,"context_line":""},{"line_number":378,"context_line":"        expt_out \u003d {\u0027%s/account.ring.gz\u0027 % self.tempdir: None,"},{"line_number":379,"context_line":"                    \u0027%s/container.ring.gz\u0027 % self.tempdir: None,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a6eadb0_8bdb381b","line":376,"updated":"2016-12-12 19:43:26.000000000","message":"you could probably capture the already-mocked-in-setup implementation before you enter the patch context manager so you can _orig_patched_hash_fn here instead of re-implementing it?\n\n        diff --git a/test/unit/common/middleware/test_recon.py b/test/unit/common/middleware/test_recon.py\n        index a21c61d..d167ccf 100644\n        --- a/test/unit/common/middleware/test_recon.py\n        +++ b/test/unit/common/middleware/test_recon.py\n        @@ -370,10 +370,12 @@ class TestReconSuccess(TestCase):\n         \n                 # If we fix a ring and it can be read again, its hash should then\n                 # appear using the same app instance\n        +        _orig_patched_hash_for_file \u003d recon.md5_hash_for_file\n        +\n                 def fake_hash_for_file(fn):\n                     if \u0027object\u0027 not in fn:\n                         raise IOError\n        -            return \u0027hash-\u0027 + os.path.basename(fn)\n        +            return _orig_patched_hash_for_file(fn)\n         \n                 expt_out \u003d {\u0027%s/account.ring.gz\u0027 % self.tempdir: None,\n                             \u0027%s/container.ring.gz\u0027 % self.tempdir: None,","commit_id":"609b5182c4282f8965cd6c04e5b2181d0ed08ef8"}]}
