)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Avishay Balderman \u003cavishayb@radware.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2013-06-11 02:43:12 -0700"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Protect PoolStats table from negative values."},{"line_number":8,"context_line":"Fixes: bug #1188959"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"Change-Id: I67038734dae5dc29e5c0666fdc98827dfd50b678"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"AAAAPX%2F%2FwGs%3D","line":7,"updated":"2013-06-11 12:05:05.000000000","message":"Please add a new line after line 7","commit_id":"536f68736d93b11efcadbddc2296db303bfe49e8"},{"author":{"_account_id":6447,"name":"Avishay Balderman","email":"avishayb@radware.com","username":"avishayb"},"change_message_id":"aaf7ae93d6096d788f3d9a861c504abc004a48a4","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Avishay Balderman \u003cavishayb@radware.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2013-06-11 02:43:12 -0700"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Protect PoolStats table from negative values."},{"line_number":8,"context_line":"Fixes: bug #1188959"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"Change-Id: I67038734dae5dc29e5c0666fdc98827dfd50b678"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"AAAAPX%2F%2FwFM%3D","line":7,"in_reply_to":"AAAAPX%2F%2FwGs%3D","updated":"2013-06-11 12:12:47.000000000","message":"OK","commit_id":"536f68736d93b11efcadbddc2296db303bfe49e8"}],"quantum/db/loadbalancer/loadbalancer_db.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":65,"context_line":"    def validate_non_negative_int(self, key, value):"},{"line_number":66,"context_line":"        if value \u003c 0:"},{"line_number":67,"context_line":"            data \u003d {\u0027key\u0027: key, \u0027value\u0027: value}"},{"line_number":68,"context_line":"            raise ValueError(_(\u0027The %(key)s field can not have negative value.\u0027"},{"line_number":69,"context_line":"                               \u0027Current value is %(value)d.\u0027) % data)"},{"line_number":70,"context_line":"        return value"},{"line_number":71,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPX%2F%2FwGk%3D","line":68,"updated":"2013-06-11 12:05:05.000000000","message":"Missing space after the .","commit_id":"536f68736d93b11efcadbddc2296db303bfe49e8"},{"author":{"_account_id":6447,"name":"Avishay Balderman","email":"avishayb@radware.com","username":"avishayb"},"change_message_id":"aaf7ae93d6096d788f3d9a861c504abc004a48a4","unresolved":false,"context_lines":[{"line_number":65,"context_line":"    def validate_non_negative_int(self, key, value):"},{"line_number":66,"context_line":"        if value \u003c 0:"},{"line_number":67,"context_line":"            data \u003d {\u0027key\u0027: key, \u0027value\u0027: value}"},{"line_number":68,"context_line":"            raise ValueError(_(\u0027The %(key)s field can not have negative value.\u0027"},{"line_number":69,"context_line":"                               \u0027Current value is %(value)d.\u0027) % data)"},{"line_number":70,"context_line":"        return value"},{"line_number":71,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPX%2F%2FwFQ%3D","line":68,"in_reply_to":"AAAAPX%2F%2FwGk%3D","updated":"2013-06-11 12:12:47.000000000","message":"OK","commit_id":"536f68736d93b11efcadbddc2296db303bfe49e8"}],"quantum/tests/unit/db/loadbalancer/test_db_loadbalancer.py":[{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"f0e8cbc32d7763cef43b791ba9a5adad53ca9395","unresolved":false,"context_lines":[{"line_number":937,"context_line":"                self.assertEqual(pool_obj.stats.__dict__[key], 0)"},{"line_number":938,"context_line":""},{"line_number":939,"context_line":"    def test_update_pool_stats_with_negative_value(self):"},{"line_number":940,"context_line":"        stats_data \u003d {\"bytes_in\": -3}"},{"line_number":941,"context_line":"        with self.pool() as pool:"},{"line_number":942,"context_line":"            pool_id \u003d pool[\u0027pool\u0027][\u0027id\u0027]"},{"line_number":943,"context_line":"            ctx \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPX%2F%2FwXI%3D","line":940,"updated":"2013-06-11 10:15:51.000000000","message":"It\u0027s better to test all 4 possible fields","commit_id":"22b0c3c6ab8a6e6ea8f488cc8fdde5e9f5d1a09a"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"unresolved":false,"context_lines":[{"line_number":937,"context_line":"                self.assertEqual(pool_obj.stats.__dict__[key], 0)"},{"line_number":938,"context_line":""},{"line_number":939,"context_line":"    def test_update_pool_stats_with_negative_value(self):"},{"line_number":940,"context_line":"        stats_data \u003d {\"bytes_in\": -3}"},{"line_number":941,"context_line":"        with self.pool() as pool:"},{"line_number":942,"context_line":"            pool_id \u003d pool[\u0027pool\u0027][\u0027id\u0027]"},{"line_number":943,"context_line":"            ctx \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPX%2F%2FwU0%3D","line":940,"in_reply_to":"AAAAPX%2F%2FwWA%3D","updated":"2013-06-11 10:33:59.000000000","message":"right, not at once, so I\u0027d suggest something like\nkeys \u003d [\"bytes_in\", \"bytes_out\", ... , ... ]\nfor key in keys:\n   stats_data \u003d { key: -1}\n   ...","commit_id":"22b0c3c6ab8a6e6ea8f488cc8fdde5e9f5d1a09a"},{"author":{"_account_id":6447,"name":"Avishay Balderman","email":"avishayb@radware.com","username":"avishayb"},"change_message_id":"aaf7ae93d6096d788f3d9a861c504abc004a48a4","unresolved":false,"context_lines":[{"line_number":937,"context_line":"                self.assertEqual(pool_obj.stats.__dict__[key], 0)"},{"line_number":938,"context_line":""},{"line_number":939,"context_line":"    def test_update_pool_stats_with_negative_value(self):"},{"line_number":940,"context_line":"        stats_data \u003d {\"bytes_in\": -3}"},{"line_number":941,"context_line":"        with self.pool() as pool:"},{"line_number":942,"context_line":"            pool_id \u003d pool[\u0027pool\u0027][\u0027id\u0027]"},{"line_number":943,"context_line":"            ctx \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPX%2F%2FwWA%3D","line":940,"in_reply_to":"AAAAPX%2F%2FwXI%3D","updated":"2013-06-11 10:24:34.000000000","message":"I do not think you can test against the 4 fields. The first negative field will cause throwing the exception so the rest of the fields are not tested.","commit_id":"22b0c3c6ab8a6e6ea8f488cc8fdde5e9f5d1a09a"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"f0e8cbc32d7763cef43b791ba9a5adad53ca9395","unresolved":false,"context_lines":[{"line_number":941,"context_line":"        with self.pool() as pool:"},{"line_number":942,"context_line":"            pool_id \u003d pool[\u0027pool\u0027][\u0027id\u0027]"},{"line_number":943,"context_line":"            ctx \u003d context.get_admin_context()"},{"line_number":944,"context_line":"            with testtools.ExpectedException(ValueError):"},{"line_number":945,"context_line":"                self.plugin._update_pool_stats(ctx, pool_id, stats_data)"},{"line_number":946,"context_line":""},{"line_number":947,"context_line":"    def test_update_pool_stats(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPX%2F%2FwW8%3D","line":944,"updated":"2013-06-11 10:15:51.000000000","message":"while this is ok and works fine, I believe more common way across unit tests is the next one:\nself.assertRaises(\n    ValueError,\n    self.plugin._update_pool_stats, ctx, pool_id, stats_data\n)\n\n(Note that parameters are passed to assertRaises rather than _update_pool_stats)","commit_id":"22b0c3c6ab8a6e6ea8f488cc8fdde5e9f5d1a09a"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"unresolved":false,"context_lines":[{"line_number":941,"context_line":"        with self.pool() as pool:"},{"line_number":942,"context_line":"            pool_id \u003d pool[\u0027pool\u0027][\u0027id\u0027]"},{"line_number":943,"context_line":"            ctx \u003d context.get_admin_context()"},{"line_number":944,"context_line":"            with testtools.ExpectedException(ValueError):"},{"line_number":945,"context_line":"                self.plugin._update_pool_stats(ctx, pool_id, stats_data)"},{"line_number":946,"context_line":""},{"line_number":947,"context_line":"    def test_update_pool_stats(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPX%2F%2FwUs%3D","line":944,"in_reply_to":"AAAAPX%2F%2FwV4%3D","updated":"2013-06-11 10:33:59.000000000","message":"I checked the file and it seems that the usage is quite mixed.\nSo you may disregard the comment.","commit_id":"22b0c3c6ab8a6e6ea8f488cc8fdde5e9f5d1a09a"},{"author":{"_account_id":6447,"name":"Avishay Balderman","email":"avishayb@radware.com","username":"avishayb"},"change_message_id":"aaf7ae93d6096d788f3d9a861c504abc004a48a4","unresolved":false,"context_lines":[{"line_number":941,"context_line":"        with self.pool() as pool:"},{"line_number":942,"context_line":"            pool_id \u003d pool[\u0027pool\u0027][\u0027id\u0027]"},{"line_number":943,"context_line":"            ctx \u003d context.get_admin_context()"},{"line_number":944,"context_line":"            with testtools.ExpectedException(ValueError):"},{"line_number":945,"context_line":"                self.plugin._update_pool_stats(ctx, pool_id, stats_data)"},{"line_number":946,"context_line":""},{"line_number":947,"context_line":"    def test_update_pool_stats(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPX%2F%2FwV4%3D","line":944,"in_reply_to":"AAAAPX%2F%2FwW8%3D","updated":"2013-06-11 10:24:34.000000000","message":"Can you please explain why?","commit_id":"22b0c3c6ab8a6e6ea8f488cc8fdde5e9f5d1a09a"}]}
