)]}'
{"test/unit/common/test_constraints.py":[{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"08780a46db2fcff97eb793067396a4727aa5702d","unresolved":false,"context_lines":[{"line_number":152,"context_line":"                   \u0027Content-Type\u0027: \u0027text/plain\u0027}"},{"line_number":153,"context_line":"        resp \u003d constraints.check_object_creation("},{"line_number":154,"context_line":"            Request.blank(\u0027/\u0027, headers\u003dheaders), \u0027object_name\u0027)"},{"line_number":155,"context_line":"        self.assertEqual(resp.status_int, HTTP_REQUEST_ENTITY_TOO_LARGE)"},{"line_number":156,"context_line":"        self.assertIn(\u0027Your request is too large\u0027, resp.body)"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        headers \u003d {\u0027Transfer-Encoding\u0027: \u0027chunked\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a98d1f4_e9bac5e0","line":155,"updated":"2016-09-29 13:33:22.000000000","message":"because this error code is specific for this type of error and the body doesn\u0027t add anything more, it is unnecessary to assert the body.  There is always a tradeoff when asserting the text in an error message, because the test will become more brittle now that any change to the description must be accounted for.  It is probably worth the tradeoff in the cases with a generic \"HTTP_BAD_REQUEST\", but I don\u0027t think so for cases where the body doesn\u0027t add anything more than the HTTP error code itself. (this applies to more lines in this review)","commit_id":"b646c606d517797d0c660847662af3d694c543ea"},{"author":{"_account_id":22059,"name":"zheng yin","email":"yin__zheng@163.com","username":"zy751713126"},"change_message_id":"8aa581fa5c4265340e4cc8a87cac9f08325c88fa","unresolved":false,"context_lines":[{"line_number":152,"context_line":"                   \u0027Content-Type\u0027: \u0027text/plain\u0027}"},{"line_number":153,"context_line":"        resp \u003d constraints.check_object_creation("},{"line_number":154,"context_line":"            Request.blank(\u0027/\u0027, headers\u003dheaders), \u0027object_name\u0027)"},{"line_number":155,"context_line":"        self.assertEqual(resp.status_int, HTTP_REQUEST_ENTITY_TOO_LARGE)"},{"line_number":156,"context_line":"        self.assertIn(\u0027Your request is too large\u0027, resp.body)"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        headers \u003d {\u0027Transfer-Encoding\u0027: \u0027chunked\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a98d1f4_0ec19080","line":155,"in_reply_to":"3a98d1f4_e9bac5e0","updated":"2016-09-30 02:18:54.000000000","message":"yes,you are right. when the error code specific for this type of error and it is unnecessary to assert the body. But when it need assert the error message when it returns \u0027HTTP_BAD_REQUEST\u0027, because many operations return \"HTTP_BAD_REQUEST\".","commit_id":"b646c606d517797d0c660847662af3d694c543ea"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"08780a46db2fcff97eb793067396a4727aa5702d","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        self.assertEqual(constraints.check_object_creation(Request.blank("},{"line_number":196,"context_line":"            \u0027/\u0027, headers\u003dheaders), name), None)"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"        max_length \u003d constraints.MAX_OBJECT_NAME_LENGTH"},{"line_number":199,"context_line":"        name \u003d \u0027o\u0027 * (max_length + 1)"},{"line_number":200,"context_line":"        resp \u003d constraints.check_object_creation("},{"line_number":201,"context_line":"            Request.blank(\u0027/\u0027, headers\u003dheaders), name)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a98d1f4_ee31eb0c","line":198,"updated":"2016-09-29 13:33:22.000000000","message":"I understand the max length constant has a long name here.  Instead of making a variable to hold what is already a constant, the constant can be imported so you won\u0027t have to use \"constraints\" every time you use the value.","commit_id":"b646c606d517797d0c660847662af3d694c543ea"},{"author":{"_account_id":22059,"name":"zheng yin","email":"yin__zheng@163.com","username":"zy751713126"},"change_message_id":"8aa581fa5c4265340e4cc8a87cac9f08325c88fa","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        self.assertEqual(constraints.check_object_creation(Request.blank("},{"line_number":196,"context_line":"            \u0027/\u0027, headers\u003dheaders), name), None)"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"        max_length \u003d constraints.MAX_OBJECT_NAME_LENGTH"},{"line_number":199,"context_line":"        name \u003d \u0027o\u0027 * (max_length + 1)"},{"line_number":200,"context_line":"        resp \u003d constraints.check_object_creation("},{"line_number":201,"context_line":"            Request.blank(\u0027/\u0027, headers\u003dheaders), name)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a98d1f4_73a2fbaf","line":198,"in_reply_to":"3a98d1f4_ee31eb0c","updated":"2016-09-30 02:18:54.000000000","message":"Done","commit_id":"b646c606d517797d0c660847662af3d694c543ea"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"5de0a0c5db30b5efc5e3745a7b0dd72c3ed83c25","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        resp \u003d constraints.check_metadata(Request.blank("},{"line_number":67,"context_line":"            \u0027/\u0027, headers\u003dheaders), \u0027container\u0027)"},{"line_number":68,"context_line":"        self.assertEqual(resp.status_int, HTTP_BAD_REQUEST)"},{"line_number":69,"context_line":"        self.assertIn(\u0027Metadata must be valid UTF-8\u0027, resp.body)"},{"line_number":70,"context_line":"        # Object\u0027s OK; its metadata isn\u0027t serialized as JSON"},{"line_number":71,"context_line":"        headers \u003d {\u0027X-Object-Meta-Foo\u0027: b\u0027\\xff\u0027}"},{"line_number":72,"context_line":"        self.assertIsNone(constraints.check_metadata(Request.blank("}],"source_content_type":"text/x-python","patch_set":3,"id":"fa6399be_15a58303","line":69,"updated":"2016-10-11 02:13:57.000000000","message":"i don\u0027t love seeing two assertions on the same string here","commit_id":"a3dbc139c398be7f2c7af0f843b85d4d53eb81ae"},{"author":{"_account_id":22059,"name":"zheng yin","email":"yin__zheng@163.com","username":"zy751713126"},"change_message_id":"177894537b5758565770e7a2e8d8b8316d376f3a","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        resp \u003d constraints.check_metadata(Request.blank("},{"line_number":67,"context_line":"            \u0027/\u0027, headers\u003dheaders), \u0027container\u0027)"},{"line_number":68,"context_line":"        self.assertEqual(resp.status_int, HTTP_BAD_REQUEST)"},{"line_number":69,"context_line":"        self.assertIn(\u0027Metadata must be valid UTF-8\u0027, resp.body)"},{"line_number":70,"context_line":"        # Object\u0027s OK; its metadata isn\u0027t serialized as JSON"},{"line_number":71,"context_line":"        headers \u003d {\u0027X-Object-Meta-Foo\u0027: b\u0027\\xff\u0027}"},{"line_number":72,"context_line":"        self.assertIsNone(constraints.check_metadata(Request.blank("}],"source_content_type":"text/x-python","patch_set":3,"id":"fa6399be_b0e4e53b","line":69,"in_reply_to":"fa6399be_15a58303","updated":"2016-10-11 02:55:02.000000000","message":"ok, I\u0027ll pay attention next time.","commit_id":"a3dbc139c398be7f2c7af0f843b85d4d53eb81ae"}]}
