)]}'
{"swift/common/middleware/name_check.py":[{"author":{"_account_id":9051,"name":"Keshava Bharadwaj","email":"kb.sankethi@gmail.com","username":"keshava"},"change_message_id":"e5f236b9fc8f9d74dceebce630f4ab43f497fe0f","unresolved":false,"context_lines":[{"line_number":84,"context_line":"            else:"},{"line_number":85,"context_line":"                pass"},{"line_number":86,"context_line":"        return False"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    def check_length(self, req):"},{"line_number":89,"context_line":"        \u0027\u0027\u0027"},{"line_number":90,"context_line":"        Checks that req.path doesn\u0027t exceed the defined maximum length"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_97b1c6e3","line":87,"updated":"2014-10-01 11:45:29.000000000","message":"Add a unit tests for this.\nA unit test would have caught it.","commit_id":"999d7c5836d8be85d542e57e540a69fab4109109"},{"author":{"_account_id":9051,"name":"Keshava Bharadwaj","email":"kb.sankethi@gmail.com","username":"keshava"},"change_message_id":"e5f236b9fc8f9d74dceebce630f4ab43f497fe0f","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        if self.check_character(req):"},{"line_number":121,"context_line":"            return HTTPBadRequest("},{"line_number":122,"context_line":"                request\u003dreq,"},{"line_number":123,"context_line":"                body\u003d(\"Object/Container/Account name contains forbidden \""},{"line_number":124,"context_line":"                      \"chars from %s\""},{"line_number":125,"context_line":"                      % self.forbidden_chars))(env, start_response)"},{"line_number":126,"context_line":"        elif self.check_length(req):"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_57b75ed8","line":123,"updated":"2014-10-01 11:45:29.000000000","message":"Can you also modify unit tests to accomodate these ?\nUnit tests are located @ swift/test/unit/common/middleware/.\n\nYou have to run .unittests before submitting a patch","commit_id":"999d7c5836d8be85d542e57e540a69fab4109109"}],"test/unit/common/middleware/test_name_check.py":[{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"c9088c0a731a51dd0d937aa244022f6ae0a995fb","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def test_maximum_length_from_config(self):"},{"line_number":66,"context_line":"        # test invalid length"},{"line_number":67,"context_line":"        self.conf.update({\u0027maximum_length\u0027: \"500\"})"},{"line_number":68,"context_line":"        path \u003d \u0027/V1.0/a/c\u0027 + \u0027o\u0027 * (MAX_LENGTH - 8)"},{"line_number":69,"context_line":"        resp \u003d Request.blank(path, environ\u003d{\u0027REQUEST_METHOD\u0027: \u0027PUT\u0027}"},{"line_number":70,"context_line":"                             ).get_response(self.test_check)"}],"source_content_type":"text/x-python","patch_set":2,"id":"baa201ad_d2a13595","line":67,"updated":"2014-10-06 18:58:06.000000000","message":"you\u0027ll need to rebuild self.test_check after this call, since otherwise it\u0027ll still have the old value.\n\nin fact, you can see that here; MAX_LENGTH is 255, so there\u0027s no reason for the call after this line to fail, since the path is 256 in length, but the conf contains a limit of 500.","commit_id":"b7680df85f9b34958b841e0a92251b44086a1650"},{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"2339ce7ee5bb065af109e57156082f7cba67370a","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        # test invalid length"},{"line_number":67,"context_line":"        orig_test_check \u003d self.test_check"},{"line_number":68,"context_line":"        conf \u003d {\u0027maximum_length\u0027: \"500\"}"},{"line_number":69,"context_line":"        self.test_check \u003d name_check.filter_factory(conf)(FakeApp())"},{"line_number":70,"context_line":"        path \u003d \u0027/V1.0/a/c\u0027 + \u0027o\u0027 * (500 - 8)"},{"line_number":71,"context_line":"        resp \u003d Request.blank(path, environ\u003d{\u0027REQUEST_METHOD\u0027: \u0027PUT\u0027}"},{"line_number":72,"context_line":"                             ).get_response(self.test_check)"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_14445f72","line":69,"updated":"2014-10-08 07:03:10.000000000","message":"I think you could omit the orig_test_check above and the self.test_check \u003d orig_test_check at the end if you just use \n\n test_check \u003d name_check.filter_factory(conf)(FakeApp())\n path \u003d \u0027/V1.0/a/c\u0027 + \u0027o\u0027 * (500 - 8)\n resp \u003d Request.blank(path, environ\u003d{\u0027REQUEST_METHOD\u0027: \u0027PUT\u0027}).get_response(test_check)","commit_id":"0c0ac09a467d2a37c1144e76d1289ec1ee62dd85"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"a13cd01fb12ddb15cab56fc9d09abc6fd510ab19","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        orig_test_check \u003d self.test_check"},{"line_number":68,"context_line":"        conf \u003d {\u0027maximum_length\u0027: \"500\"}"},{"line_number":69,"context_line":"        self.test_check \u003d name_check.filter_factory(conf)(FakeApp())"},{"line_number":70,"context_line":"        path \u003d \u0027/V1.0/a/c\u0027 + \u0027o\u0027 * (500 - 8)"},{"line_number":71,"context_line":"        resp \u003d Request.blank(path, environ\u003d{\u0027REQUEST_METHOD\u0027: \u0027PUT\u0027}"},{"line_number":72,"context_line":"                             ).get_response(self.test_check)"},{"line_number":73,"context_line":"        self.assertEquals("}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_14837fcc","line":70,"updated":"2014-10-08 07:00:45.000000000","message":"Seeing as you are testing the maximum length from the config, this test works fine as it dosn\u0027t matter the name of the account, container or object. As it\u0027s just testing the length of the path itself.\n\nJust for completeness sake, if you were trying to match the account/container/object api and were trying to make a really long object name, ie wanted:\n\n  /V1,0/a/c/ooooooooo...\n\nThen you are missing a \u0027/\u0027 before the \u0027ooo...\u0027. As it currently stands you are testing a container name of coooo... rather then an object.. but like I said, this test actually doesn\u0027t matter as it is still a bounds check of the path limit only.\n\nThe valid path test below has the same problem, the path is pointing to a container at a/coooooooooo... which again is fine for the test.. but if you intended on it being a really long object name then you are missing the additional \u0027/\u0027:\n\n  path \u003d \u0027/V1.0/a/c/\u0027 + \u0027o\u0027 * (500 - 8)","commit_id":"0c0ac09a467d2a37c1144e76d1289ec1ee62dd85"}]}
