)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"ed0087be0d5dcb5625e35e89d2087c777f33ce57","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Some tests regarding the _required_attribute(s) functions in the wsgi"},{"line_number":10,"context_line":"module seemed to be somewhat confusing, so I refactored them trying to"},{"line_number":11,"context_line":"increase redability"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: Id9aedcb05063cf0d618399847f6afe73c800aa93"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7adec928_a874dbfd","line":11,"updated":"2014-05-08 13:58:34.000000000","message":"also s/redability/readability","commit_id":"21df11a7fd2edc4692ae678d818abb124bdc2441"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"c9a3c155f3e74b5301ba1f07bd2ea39c53048a4f","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Some tests regarding the _required_attribute(s) functions in the wsgi"},{"line_number":10,"context_line":"module seemed to be somewhat confusing, so I refactored them trying to"},{"line_number":11,"context_line":"increase redability"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: Id9aedcb05063cf0d618399847f6afe73c800aa93"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7adec928_4fb612de","line":11,"updated":"2014-05-07 20:47:58.000000000","message":"bug?","commit_id":"21df11a7fd2edc4692ae678d818abb124bdc2441"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"13f942a8b56fd8a8b2362d6ac5654b694fa863ed","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Some tests regarding the _required_attribute(s) functions in the wsgi"},{"line_number":10,"context_line":"module seemed to be somewhat confusing, so I refactored them trying to"},{"line_number":11,"context_line":"increase redability"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: Id9aedcb05063cf0d618399847f6afe73c800aa93"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7adec928_16f97bc8","line":11,"in_reply_to":"7adec928_4fb612de","updated":"2014-05-08 06:19:48.000000000","message":"I uploaded these tests in a past commit, and it was mentioned in the comments that the tests were a bit confusing; Yet the code was merged to master. So I decided to try and make them more readable or understandable. So, in this case, there is no bug associated with this.","commit_id":"21df11a7fd2edc4692ae678d818abb124bdc2441"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"d254acfa11dbf56235ed1be11175bc822bcda04a","unresolved":false,"context_lines":[{"line_number":10,"context_line":"module seemed to be somewhat confusing, so I refactored them trying to"},{"line_number":11,"context_line":"increase readability."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Note that for the test_no_required_attributes_present test, assertRaises"},{"line_number":14,"context_line":"was not used in that case since I explicitly wanted to check that the"},{"line_number":15,"context_line":"attributes are correctly put in the exception message."},{"line_number":16,"context_line":"assertRaisesRegexp exists and would assert this issue, but that wouldn\u0027t"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"7adec928_9cf99e82","line":13,"updated":"2014-05-18 16:03:48.000000000","message":"This should be a comment in the code not the commit message.","commit_id":"5ad6ab3094d99eb3119d0ffd6000f15063752bd8"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"aca32c6ab3d10701fa978592293e9858039cec46","unresolved":false,"context_lines":[{"line_number":10,"context_line":"module seemed to be somewhat confusing, so I refactored them trying to"},{"line_number":11,"context_line":"increase readability."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Note that for the test_no_required_attributes_present test, assertRaises"},{"line_number":14,"context_line":"was not used in that case since I explicitly wanted to check that the"},{"line_number":15,"context_line":"attributes are correctly put in the exception message."},{"line_number":16,"context_line":"assertRaisesRegexp exists and would assert this issue, but that wouldn\u0027t"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"7adec928_f4a7f208","line":13,"in_reply_to":"7adec928_9cf99e82","updated":"2014-05-19 07:35:29.000000000","message":"Will do","commit_id":"5ad6ab3094d99eb3119d0ffd6000f15063752bd8"}],"keystone/tests/test_wsgi.py":[{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"c92e925dec130a1bbabc621b8a75a0df0beaef23","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        app \u003d FakeAttributeCheckerApp()"},{"line_number":109,"context_line":"        req \u003d self._make_request(url\u003d\u0027/?1\u003d2\u0027)"},{"line_number":110,"context_line":"        resp \u003d req.get_response(app)"},{"line_number":111,"context_line":"        self.assertTrue(app.ensure_attribute(resp.body, \u00271\u0027))"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    def test_require_attribute(self):"},{"line_number":114,"context_line":"        app \u003d FakeAttributeCheckerApp()"}],"source_content_type":"text/x-python","patch_set":2,"id":"7adec928_12aa7c70","line":111,"updated":"2014-05-07 14:52:31.000000000","message":"you could remove the return True from the helper functions above, and get rid of assertTrue here. If the function blows up then the test fails. just a thought","commit_id":"21df11a7fd2edc4692ae678d818abb124bdc2441"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"aff9699083bc2997fa5b0986ade28a5ad589355c","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        app \u003d FakeAttributeCheckerApp()"},{"line_number":109,"context_line":"        req \u003d self._make_request(url\u003d\u0027/?1\u003d2\u0027)"},{"line_number":110,"context_line":"        resp \u003d req.get_response(app)"},{"line_number":111,"context_line":"        self.assertTrue(app.ensure_attribute(resp.body, \u00271\u0027))"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    def test_require_attribute(self):"},{"line_number":114,"context_line":"        app \u003d FakeAttributeCheckerApp()"}],"source_content_type":"text/x-python","patch_set":2,"id":"7adec928_c5e68916","line":111,"in_reply_to":"7adec928_12aa7c70","updated":"2014-05-07 16:50:37.000000000","message":"Yeah, that could have been, and in that case I could have named it assert instead of ensure, since it\u0027s the behaviour of an assertion, but then it would be some sort of \"null test\", and I\u0027ve never really liked those to be honest, that\u0027s why I decided to return something. Just a matter of style I guess.","commit_id":"21df11a7fd2edc4692ae678d818abb124bdc2441"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"9d67887f67bcbc2f90432b39f77f00d685e02ea9","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        req \u003d self._make_request(url\u003d\u0027/\u0027)"},{"line_number":136,"context_line":"        resp \u003d req.get_response(app)"},{"line_number":137,"context_line":"        exception_thrown \u003d False"},{"line_number":138,"context_line":"        try:"},{"line_number":139,"context_line":"            app.ensure_attributes(resp.body, [\u0027missing_attribute1\u0027,"},{"line_number":140,"context_line":"                                              \u0027missing_attribute2\u0027])"},{"line_number":141,"context_line":"        except exception.ValidationError as ex:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7adec928_4f85d9ce","line":138,"updated":"2014-05-13 13:17:40.000000000","message":"why have this and not just do an assert raises?","commit_id":"06321155ef0a2144f7e21e6d7bb8987b14da000a"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"edac216e34ce34bb8e198ef0a1438077a29f8377","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        req \u003d self._make_request(url\u003d\u0027/\u0027)"},{"line_number":136,"context_line":"        resp \u003d req.get_response(app)"},{"line_number":137,"context_line":"        exception_thrown \u003d False"},{"line_number":138,"context_line":"        try:"},{"line_number":139,"context_line":"            app.ensure_attributes(resp.body, [\u0027missing_attribute1\u0027,"},{"line_number":140,"context_line":"                                              \u0027missing_attribute2\u0027])"},{"line_number":141,"context_line":"        except exception.ValidationError as ex:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7adec928_6bcb6253","line":138,"in_reply_to":"7adec928_2b9b1a68","updated":"2014-05-13 20:10:20.000000000","message":"Would it be better if I put the explanation in the commit message?","commit_id":"06321155ef0a2144f7e21e6d7bb8987b14da000a"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"e8cbdad0d477c7abdb851abf64f400877da31784","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        req \u003d self._make_request(url\u003d\u0027/\u0027)"},{"line_number":136,"context_line":"        resp \u003d req.get_response(app)"},{"line_number":137,"context_line":"        exception_thrown \u003d False"},{"line_number":138,"context_line":"        try:"},{"line_number":139,"context_line":"            app.ensure_attributes(resp.body, [\u0027missing_attribute1\u0027,"},{"line_number":140,"context_line":"                                              \u0027missing_attribute2\u0027])"},{"line_number":141,"context_line":"        except exception.ValidationError as ex:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7adec928_77feeb39","line":138,"in_reply_to":"7adec928_4f85d9ce","updated":"2014-05-13 15:37:00.000000000","message":"Because I wanted to test that all the attributes are being included in the error message, as stated in the TODO that this takes care of.","commit_id":"06321155ef0a2144f7e21e6d7bb8987b14da000a"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"d492f49d9ce285bb95d9c80a9c4825b26e21d625","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        req \u003d self._make_request(url\u003d\u0027/\u0027)"},{"line_number":136,"context_line":"        resp \u003d req.get_response(app)"},{"line_number":137,"context_line":"        exception_thrown \u003d False"},{"line_number":138,"context_line":"        try:"},{"line_number":139,"context_line":"            app.ensure_attributes(resp.body, [\u0027missing_attribute1\u0027,"},{"line_number":140,"context_line":"                                              \u0027missing_attribute2\u0027])"},{"line_number":141,"context_line":"        except exception.ValidationError as ex:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7adec928_8b734ee6","line":138,"in_reply_to":"7adec928_6bcb6253","updated":"2014-05-13 20:29:09.000000000","message":"looks good to me, thanks for adding to the commit message.","commit_id":"06321155ef0a2144f7e21e6d7bb8987b14da000a"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"14ef511d749c73f94c01b2f2effdad0ef2c6a718","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        req \u003d self._make_request(url\u003d\u0027/\u0027)"},{"line_number":136,"context_line":"        resp \u003d req.get_response(app)"},{"line_number":137,"context_line":"        exception_thrown \u003d False"},{"line_number":138,"context_line":"        try:"},{"line_number":139,"context_line":"            app.ensure_attributes(resp.body, [\u0027missing_attribute1\u0027,"},{"line_number":140,"context_line":"                                              \u0027missing_attribute2\u0027])"},{"line_number":141,"context_line":"        except exception.ValidationError as ex:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7adec928_2b9b1a68","line":138,"in_reply_to":"7adec928_77feeb39","updated":"2014-05-13 20:08:32.000000000","message":"Thanks for the explanation.","commit_id":"06321155ef0a2144f7e21e6d7bb8987b14da000a"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"4644c1f94dfc19e2f316f3edfc926f40eebbfc74","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        req \u003d self._make_request(url\u003d\u0027/?1\u003d2\u0027)"},{"line_number":116,"context_line":"        resp \u003d req.get_response(app)"},{"line_number":117,"context_line":"        self.assertRaises(exception.ValidationError,"},{"line_number":118,"context_line":"                          app.ensure_attribute, *(resp.body, \u0027a\u0027))"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def test_successful_require_multiple_attributes(self):"},{"line_number":121,"context_line":"        app \u003d FakeAttributeCheckerApp()"}],"source_content_type":"text/x-python","patch_set":5,"id":"7adec928_43783f2b","line":118,"updated":"2014-05-14 18:20:57.000000000","message":"nit/opinion: i think we normally list out all the args, instead of using the * operator.\n\n  self.assertRaises(exception.ValidationError,\n  app.ensure_attribute, resp.body, \u0027a\u0027)\n\nif someone else raises it, then change, but otherwise, it\u0027s cool","commit_id":"e2e0ab2e956339b730c0b710935dcc90ea50751e"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"d254acfa11dbf56235ed1be11175bc822bcda04a","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    def index(self, context):"},{"line_number":41,"context_line":"        return context[\u0027query_string\u0027]"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def ensure_attribute(self, body, attr):"},{"line_number":44,"context_line":"        body_dict \u003d jsonutils.loads(body)"},{"line_number":45,"context_line":"        self._require_attribute(body_dict, attr)"},{"line_number":46,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_7c38523d","line":43,"updated":"2014-05-18 16:03:48.000000000","message":"The new name doesn\u0027t make this any clearer to me. assert_attribute would make it clear that it fails if the attribute isn\u0027t present.\n\nAlso, did you consider using a matcher instead?","commit_id":"5ad6ab3094d99eb3119d0ffd6000f15063752bd8"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"d254acfa11dbf56235ed1be11175bc822bcda04a","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    def ensure_attribute(self, body, attr):"},{"line_number":44,"context_line":"        body_dict \u003d jsonutils.loads(body)"},{"line_number":45,"context_line":"        self._require_attribute(body_dict, attr)"},{"line_number":46,"context_line":"        return True"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def ensure_attributes(self, body, attr):"},{"line_number":49,"context_line":"        body_dict \u003d jsonutils.loads(body)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_dc1de6bf","line":46,"updated":"2014-05-18 16:03:48.000000000","message":"could remove this line if changed name to assert_attribute_in_body.","commit_id":"5ad6ab3094d99eb3119d0ffd6000f15063752bd8"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"d254acfa11dbf56235ed1be11175bc822bcda04a","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        self._require_attribute(body_dict, attr)"},{"line_number":46,"context_line":"        return True"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def ensure_attributes(self, body, attr):"},{"line_number":49,"context_line":"        body_dict \u003d jsonutils.loads(body)"},{"line_number":50,"context_line":"        self._require_attributes(body_dict, attr)"},{"line_number":51,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_fc4382ac","line":48,"updated":"2014-05-18 16:03:48.000000000","message":"why change the name of the function? The new name doesn\u0027t make it any clearer to me.","commit_id":"5ad6ab3094d99eb3119d0ffd6000f15063752bd8"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"d254acfa11dbf56235ed1be11175bc822bcda04a","unresolved":false,"context_lines":[{"line_number":140,"context_line":"                                              \u0027missing_attribute2\u0027])"},{"line_number":141,"context_line":"        except exception.ValidationError as ex:"},{"line_number":142,"context_line":"            exception_thrown \u003d True"},{"line_number":143,"context_line":"            self.assertTrue(\u0027missing_attribute1\u0027 in ex.message)"},{"line_number":144,"context_line":"            self.assertTrue(\u0027missing_attribute2\u0027 in ex.message)"},{"line_number":145,"context_line":"        self.assertTrue(exception_thrown)"},{"line_number":146,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_fc1aa2c4","line":143,"updated":"2014-05-18 16:03:48.000000000","message":"(unrelated, but this should be using assertIn, or assertThat(matchers.In))","commit_id":"5ad6ab3094d99eb3119d0ffd6000f15063752bd8"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"aca32c6ab3d10701fa978592293e9858039cec46","unresolved":false,"context_lines":[{"line_number":140,"context_line":"                                              \u0027missing_attribute2\u0027])"},{"line_number":141,"context_line":"        except exception.ValidationError as ex:"},{"line_number":142,"context_line":"            exception_thrown \u003d True"},{"line_number":143,"context_line":"            self.assertTrue(\u0027missing_attribute1\u0027 in ex.message)"},{"line_number":144,"context_line":"            self.assertTrue(\u0027missing_attribute2\u0027 in ex.message)"},{"line_number":145,"context_line":"        self.assertTrue(exception_thrown)"},{"line_number":146,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_544a6655","line":143,"in_reply_to":"7adec928_fc1aa2c4","updated":"2014-05-19 07:35:29.000000000","message":"Thanks, I had not used matchers before.","commit_id":"5ad6ab3094d99eb3119d0ffd6000f15063752bd8"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"d254acfa11dbf56235ed1be11175bc822bcda04a","unresolved":false,"context_lines":[{"line_number":142,"context_line":"            exception_thrown \u003d True"},{"line_number":143,"context_line":"            self.assertTrue(\u0027missing_attribute1\u0027 in ex.message)"},{"line_number":144,"context_line":"            self.assertTrue(\u0027missing_attribute2\u0027 in ex.message)"},{"line_number":145,"context_line":"        self.assertTrue(exception_thrown)"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    def test_render_response_custom_headers(self):"},{"line_number":148,"context_line":"        resp \u003d wsgi.render_response(headers\u003d[(\u0027Custom-Header\u0027, \u0027Some-Value\u0027)])"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_bc6bba1c","line":145,"updated":"2014-05-18 16:03:48.000000000","message":"should be able to use \"else: self.fail()\" or whatever to get rid of the exception_thrown variable.","commit_id":"5ad6ab3094d99eb3119d0ffd6000f15063752bd8"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"aca32c6ab3d10701fa978592293e9858039cec46","unresolved":false,"context_lines":[{"line_number":142,"context_line":"            exception_thrown \u003d True"},{"line_number":143,"context_line":"            self.assertTrue(\u0027missing_attribute1\u0027 in ex.message)"},{"line_number":144,"context_line":"            self.assertTrue(\u0027missing_attribute2\u0027 in ex.message)"},{"line_number":145,"context_line":"        self.assertTrue(exception_thrown)"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"    def test_render_response_custom_headers(self):"},{"line_number":148,"context_line":"        resp \u003d wsgi.render_response(headers\u003d[(\u0027Custom-Header\u0027, \u0027Some-Value\u0027)])"}],"source_content_type":"text/x-python","patch_set":6,"id":"7adec928_745cc219","line":145,"in_reply_to":"7adec928_bc6bba1c","updated":"2014-05-19 07:35:29.000000000","message":"I like the style, thanks for the suggestion, sure looks cleaner with it.","commit_id":"5ad6ab3094d99eb3119d0ffd6000f15063752bd8"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"4485760ad0a0f8e5d774cda7e275e1aae3f9e36a","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    def index(self, context):"},{"line_number":41,"context_line":"        return context[\u0027query_string\u0027]"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def assert_attribute(self, body, attr):"},{"line_number":44,"context_line":"        body_dict \u003d jsonutils.loads(body)"},{"line_number":45,"context_line":"        self._require_attribute(body_dict, attr)"},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7adec928_aa59738f","line":43,"updated":"2014-05-19 15:28:37.000000000","message":"Couldn\u0027t these two be combined now? The method signatures are the same and they execute the same logic (with the exception of either calling _require_attributes or _require_attribute). We could detect the type and call accordingly. \n\nif a list is passed in be sure to call _require_attributes and if not then just call _require_attribute\n\n    if isinstance(attr, list): \n        self._require_attributes(body_dict, attr)\n    elif isinstance(attr, str): \n        self._require_attribute(body_dict,  attr)\n    else: \n        # fix attrs you\u0027re passing in\n\n\nor something along those lines?","commit_id":"3676688409a4c331e5147ce44cfe93e03fffe7d6"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"0a72ea73b3c386f53c2dff73a165ee0c1c7fca00","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    def index(self, context):"},{"line_number":41,"context_line":"        return context[\u0027query_string\u0027]"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def assert_attribute(self, body, attr):"},{"line_number":44,"context_line":"        body_dict \u003d jsonutils.loads(body)"},{"line_number":45,"context_line":"        self._require_attribute(body_dict, attr)"},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7adec928_40be03af","line":43,"updated":"2014-05-19 23:38:42.000000000","message":"docstrings would be nice.","commit_id":"3676688409a4c331e5147ce44cfe93e03fffe7d6"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"04e83aea76fc24028c9ca33d85a3e29de73407ea","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    def index(self, context):"},{"line_number":41,"context_line":"        return context[\u0027query_string\u0027]"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def assert_attribute(self, body, attr):"},{"line_number":44,"context_line":"        body_dict \u003d jsonutils.loads(body)"},{"line_number":45,"context_line":"        self._require_attribute(body_dict, attr)"},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7adec928_9e8eb92c","line":43,"in_reply_to":"7adec928_aa59738f","updated":"2014-05-19 17:34:27.000000000","message":"to be honest I would prefer to put a decorator that does the jsonutils.loads(body), and passes the result to the function, but but dividing by class type is not something I am keen for. Would you prefer that?","commit_id":"3676688409a4c331e5147ce44cfe93e03fffe7d6"},{"author":{"_account_id":6486,"name":"Brant Knudson","email":"blk@acm.org","username":"blk-u"},"change_message_id":"0a72ea73b3c386f53c2dff73a165ee0c1c7fca00","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        req \u003d self._make_request(url\u003d\u0027/?1\u003d2\u0027)"},{"line_number":114,"context_line":"        resp \u003d req.get_response(app)"},{"line_number":115,"context_line":"        self.assertRaises(exception.ValidationError,"},{"line_number":116,"context_line":"                          app.assert_attribute, resp.body, \u0027a\u0027)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def test_successful_require_multiple_attributes(self):"},{"line_number":119,"context_line":"        app \u003d FakeAttributeCheckerApp()"}],"source_content_type":"text/x-python","patch_set":7,"id":"7adec928_40ec43bb","line":116,"updated":"2014-05-19 23:38:42.000000000","message":"what is this testing? that assert_attribute works as expected? Why test the test code? This is less clear than it was before.","commit_id":"3676688409a4c331e5147ce44cfe93e03fffe7d6"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"d22c209320c103cbdf9b3242f55c3894ef020fdd","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        return context[\u0027query_string\u0027]"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    @receives_parsed_request"},{"line_number":51,"context_line":"    def assert_attribute(self, ref, attr):"},{"line_number":52,"context_line":"        \"\"\"Asserts that the given request has a certain attribute.\"\"\""},{"line_number":53,"context_line":"        self._require_attribute(ref, attr)"},{"line_number":54,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"7adec928_bc376faf","line":51,"updated":"2014-05-23 21:23:02.000000000","message":"Also I agree with Lance\u0027s point, but I have a different change in mind. If I were writing this from scratch I would only have one method \u0027assert_attributes(ref, *attrs)\u0027 and then always calls \u0027self._require_attributes(json.loads(body), attrs)\u0027\n\nNot saying that you have to change it to do this, but food for thought.","commit_id":"a9a92bd19b14abca764d4156f879b51eed90844a"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"d22c209320c103cbdf9b3242f55c3894ef020fdd","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    @receives_parsed_request"},{"line_number":51,"context_line":"    def assert_attribute(self, ref, attr):"},{"line_number":52,"context_line":"        \"\"\"Asserts that the given request has a certain attribute.\"\"\""},{"line_number":53,"context_line":"        self._require_attribute(ref, attr)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    @receives_parsed_request"},{"line_number":56,"context_line":"    def assert_attributes(self, ref, attr):"}],"source_content_type":"text/x-python","patch_set":8,"id":"7adec928_9c46334e","line":53,"updated":"2014-05-23 21:23:02.000000000","message":"Why not just decode the JSON inline and then you can get rid of the decorator and save some code?\n\n  self._require_attribute(json.loads(body), attr)","commit_id":"a9a92bd19b14abca764d4156f879b51eed90844a"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"d22c209320c103cbdf9b3242f55c3894ef020fdd","unresolved":false,"context_lines":[{"line_number":142,"context_line":"        req \u003d self._make_request(url\u003d\u0027/\u0027)"},{"line_number":143,"context_line":"        resp \u003d req.get_response(app)"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":"        # NOTE(jaosorior): assertRaises was not used since I explicitly wanted"},{"line_number":146,"context_line":"        # to check that the attributes are correctly put in the exception"},{"line_number":147,"context_line":"        # message."},{"line_number":148,"context_line":"        # assertRaisesRegexp exists and would resolve this issue, but that"}],"source_content_type":"text/x-python","patch_set":8,"id":"7adec928_5c358bd9","line":145,"updated":"2014-05-23 21:23:02.000000000","message":"You can actually just do something like this to make this test more concise:\n\n  ex \u003d self.assertRaises(exception.ValidationError, resp.body, [...])\n  self.assertThat(ex.message, matchers.Contains(...))","commit_id":"a9a92bd19b14abca764d4156f879b51eed90844a"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"e09c5b6397b169e4b87a9cf11c895adda788b2e6","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        app \u003d FakeAttributeCheckerApp()"},{"line_number":115,"context_line":"        req \u003d self._make_request(url\u003d\u0027/?1\u003d2\u0027)"},{"line_number":116,"context_line":"        resp \u003d req.get_response(app)"},{"line_number":117,"context_line":"        self.assertRaises(exception.ValidationError,"},{"line_number":118,"context_line":"                          app.assert_attribute, resp.body, \u0027a\u0027)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def test_successful_require_multiple_attributes(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"3ae8d1ca_ab7ea0e2","line":117,"updated":"2014-05-27 16:22:21.000000000","message":"Since I think resp is a webob Response object it wouldn\u0027t be too tough to add the status code checks here too, for example:\n\n    self.assertEqual(resp.status_code, \u0027400\u0027)","commit_id":"ad1f3287df42eb6c70aff0089068e5f240876d6a"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"7b9ef7a2e965af2d3539cec666d58ae2b5f3db2d","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        app \u003d FakeAttributeCheckerApp()"},{"line_number":115,"context_line":"        req \u003d self._make_request(url\u003d\u0027/?1\u003d2\u0027)"},{"line_number":116,"context_line":"        resp \u003d req.get_response(app)"},{"line_number":117,"context_line":"        self.assertRaises(exception.ValidationError,"},{"line_number":118,"context_line":"                          app.assert_attribute, resp.body, \u0027a\u0027)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def test_successful_require_multiple_attributes(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"3ae8d1ca_6d956c3f","line":117,"in_reply_to":"3ae8d1ca_350ad48a","updated":"2014-05-28 12:25:23.000000000","message":"I don\u0027t think that\u0027s necessary for this patch, but I don\u0027t think it\u0027s a bad idea overall for another patch. All responses in this file could be checked.","commit_id":"ad1f3287df42eb6c70aff0089068e5f240876d6a"},{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"3268993ce2ec9b3b4f7435064145fce8dce36e57","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        app \u003d FakeAttributeCheckerApp()"},{"line_number":115,"context_line":"        req \u003d self._make_request(url\u003d\u0027/?1\u003d2\u0027)"},{"line_number":116,"context_line":"        resp \u003d req.get_response(app)"},{"line_number":117,"context_line":"        self.assertRaises(exception.ValidationError,"},{"line_number":118,"context_line":"                          app.assert_attribute, resp.body, \u0027a\u0027)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def test_successful_require_multiple_attributes(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"3ae8d1ca_238453d3","line":117,"in_reply_to":"3ae8d1ca_6d956c3f","updated":"2014-05-28 13:19:17.000000000","message":"sure, we can add in another patch. I\u0027ll do some checking and see if we can do something like this.","commit_id":"ad1f3287df42eb6c70aff0089068e5f240876d6a"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"635a5fbb46ab6b8c777766627bafb4bb0c5c4afa","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        app \u003d FakeAttributeCheckerApp()"},{"line_number":115,"context_line":"        req \u003d self._make_request(url\u003d\u0027/?1\u003d2\u0027)"},{"line_number":116,"context_line":"        resp \u003d req.get_response(app)"},{"line_number":117,"context_line":"        self.assertRaises(exception.ValidationError,"},{"line_number":118,"context_line":"                          app.assert_attribute, resp.body, \u0027a\u0027)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def test_successful_require_multiple_attributes(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"3ae8d1ca_350ad48a","line":117,"in_reply_to":"3ae8d1ca_ab7ea0e2","updated":"2014-05-28 12:11:26.000000000","message":"I don\u0027t see how, since this only raises the exception, it doesn\u0027t really add or change any status codes, can you please elaborate?","commit_id":"ad1f3287df42eb6c70aff0089068e5f240876d6a"},{"author":{"_account_id":7725,"name":"David Stanek","email":"dstanek@dstanek.com","username":"dstanek"},"change_message_id":"7b9ef7a2e965af2d3539cec666d58ae2b5f3db2d","unresolved":false,"context_lines":[{"line_number":128,"context_line":"        req \u003d self._make_request(url\u003d\u0027/?a\u003d1\u0026b\u003d2\u0027)"},{"line_number":129,"context_line":"        resp \u003d req.get_response(app)"},{"line_number":130,"context_line":"        self.assertRaises(exception.ValidationError, app.assert_attributes,"},{"line_number":131,"context_line":"                          resp.body, [\u0027a\u0027, \u0027missing_attribute\u0027])"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def test_no_required_attributes_present(self):"},{"line_number":134,"context_line":"        app \u003d FakeAttributeCheckerApp()"}],"source_content_type":"text/x-python","patch_set":9,"id":"3ae8d1ca_0dbce8ba","line":131,"updated":"2014-05-28 12:25:23.000000000","message":"This test isn\u0027t as strict as the old version. The older version looked for \u0027missing_attribute\u0027 in the exception message.","commit_id":"ad1f3287df42eb6c70aff0089068e5f240876d6a"}]}
