)]}'
{"glance/common/wsgi.py":[{"author":{"_account_id":177,"name":"Alex Meade","email":"mr.alex.meade@gmail.com","username":"alex-meade"},"change_message_id":"78b94d8fa00208b2e6592cb2b003f54c26f1a3ca","unresolved":false,"context_lines":[{"line_number":434,"context_line":"    @classmethod"},{"line_number":435,"context_line":"    def factory(cls, global_conf, **local_conf):"},{"line_number":436,"context_line":"        mapper \u003d APIMapper()"},{"line_number":437,"context_line":"        mapper.redirect(\"\", \"/\")"},{"line_number":438,"context_line":"        return cls(mapper)"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"    @webob.dec.wsgify"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOn%2F%2FyCk%3D","line":437,"updated":"2013-04-23 15:54:55.000000000","message":"I think there would be some value in adding another test that ensures this redirect is added.","commit_id":"d0ec137bf5448d1fd43886a248ee6e6836d0fd32"},{"author":{"_account_id":177,"name":"Alex Meade","email":"mr.alex.meade@gmail.com","username":"alex-meade"},"change_message_id":"cabf8898a47ac7f353e7431b29ab47fbfc1c71e4","unresolved":false,"context_lines":[{"line_number":434,"context_line":"    @classmethod"},{"line_number":435,"context_line":"    def factory(cls, global_conf, **local_conf):"},{"line_number":436,"context_line":"        mapper \u003d APIMapper()"},{"line_number":437,"context_line":"        mapper.redirect(\"\", \"/\")"},{"line_number":438,"context_line":"        return cls(mapper)"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"    @webob.dec.wsgify"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOn%2F%2Ftbw%3D","line":437,"in_reply_to":"AAAAOn%2F%2Ftlk%3D","updated":"2013-04-26 17:04:17.000000000","message":"I agree with Flavio.","commit_id":"d0ec137bf5448d1fd43886a248ee6e6836d0fd32"},{"author":{"_account_id":177,"name":"Alex Meade","email":"mr.alex.meade@gmail.com","username":"alex-meade"},"change_message_id":"c58caeb68150ac923860c1485a2ee881dddd0322","unresolved":false,"context_lines":[{"line_number":434,"context_line":"    @classmethod"},{"line_number":435,"context_line":"    def factory(cls, global_conf, **local_conf):"},{"line_number":436,"context_line":"        mapper \u003d APIMapper()"},{"line_number":437,"context_line":"        mapper.redirect(\"\", \"/\")"},{"line_number":438,"context_line":"        return cls(mapper)"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"    @webob.dec.wsgify"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOn%2F%2Fx7I%3D","line":437,"in_reply_to":"AAAAOn%2F%2Fx%2FI%3D","updated":"2013-04-23 16:43:10.000000000","message":"I saw the functional test and that would indeed make sure this is working. We are moving away from spinning up an actual server in the tests since that makes them very slow but I would rather have the functional tests you had rather than nothing testing this. I don\u0027t see a much simpler way to test it however.","commit_id":"d0ec137bf5448d1fd43886a248ee6e6836d0fd32"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"5752cfed0492b3761dca91150636fc08dd8c7499","unresolved":false,"context_lines":[{"line_number":434,"context_line":"    @classmethod"},{"line_number":435,"context_line":"    def factory(cls, global_conf, **local_conf):"},{"line_number":436,"context_line":"        mapper \u003d APIMapper()"},{"line_number":437,"context_line":"        mapper.redirect(\"\", \"/\")"},{"line_number":438,"context_line":"        return cls(mapper)"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"    @webob.dec.wsgify"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOn%2F%2Ftlk%3D","line":437,"in_reply_to":"AAAAOn%2F%2Fx7I%3D","updated":"2013-04-26 16:06:41.000000000","message":"Hey :)\n\nI\u0027d rather move the redirect to Router\u0027s __init__ since, IMHO, we want this behavior in glance\u0027s APIs and can be easily overwritten.\n\nIf the above doesn\u0027t make sense, I\u0027d then test Router.factory instead of creating a functional test for it. Router.factory(None) returns a Router instance that can be used in the unittest \n\nCheers","commit_id":"d0ec137bf5448d1fd43886a248ee6e6836d0fd32"},{"author":{"_account_id":6662,"name":"James Li","email":"yueli.m@gmail.com","username":"james-li-3"},"change_message_id":"589075f126aabbbaddd030cae65b20ddc6f1d6bc","unresolved":false,"context_lines":[{"line_number":434,"context_line":"    @classmethod"},{"line_number":435,"context_line":"    def factory(cls, global_conf, **local_conf):"},{"line_number":436,"context_line":"        mapper \u003d APIMapper()"},{"line_number":437,"context_line":"        mapper.redirect(\"\", \"/\")"},{"line_number":438,"context_line":"        return cls(mapper)"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"    @webob.dec.wsgify"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOn%2F%2Fx%2FI%3D","line":437,"in_reply_to":"AAAAOn%2F%2FyCk%3D","updated":"2013-04-23 16:13:51.000000000","message":"Can you give an example about how the test looks like? If you look at the history of this change, you might notice I tried a functional test firstly, then test with v1 and v2 routers, and then  test with Router as it is now. I am a bit exhausted of ideas of how to write a test for this piece of code.","commit_id":"d0ec137bf5448d1fd43886a248ee6e6836d0fd32"}],"glance/tests/functional/test_api.py":[{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"a3e35e49c829dacd57648204812900371274a51d","unresolved":false,"context_lines":[{"line_number":293,"context_line":"        \"\"\"Test Glance redirects /v# to /v#/\"\"\""},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"        self.cleanup()"},{"line_number":296,"context_line":"        self.start_servers(**self.__dict__.copy())"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"        path \u003d \u0027http://%s:%d/v1\u0027 % (\u0027127.0.0.1\u0027, self.api_port)"},{"line_number":299,"context_line":"        http \u003d httplib2.Http()"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2F5qM%3D","line":296,"updated":"2013-04-12 09:35:49.000000000","message":"Hey,\n\nI think it would be better to test this using `webob.Request` instead of starting up a server.\n\nThanks :)","commit_id":"7e4e0d27b6d9c84b0b2d0d10833c5698231bed71"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"16396ffa806f021603148cc44d7a7243499d4025","unresolved":false,"context_lines":[{"line_number":293,"context_line":"        \"\"\"Test Glance redirects /v# to /v#/\"\"\""},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"        self.cleanup()"},{"line_number":296,"context_line":"        self.start_servers(**self.__dict__.copy())"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"        path \u003d \u0027http://%s:%d/v1\u0027 % (\u0027127.0.0.1\u0027, self.api_port)"},{"line_number":299,"context_line":"        http \u003d httplib2.Http()"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2F5mw%3D","line":296,"in_reply_to":"AAAAOn%2F%2F5pU%3D","updated":"2013-04-12 11:36:06.000000000","message":"Hey,\n\nIt makes sense since that would be a more \"unit\" like test, even though TestRootApi sounds like the most logical place to have this test.\n\nLooks like glance/tests/unit/api/test_common.py is a good place to put this test in.\n\nCheers","commit_id":"7e4e0d27b6d9c84b0b2d0d10833c5698231bed71"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"c0b135032671bcbb13b6db0fc8e3e9338dbb135d","unresolved":false,"context_lines":[{"line_number":293,"context_line":"        \"\"\"Test Glance redirects /v# to /v#/\"\"\""},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"        self.cleanup()"},{"line_number":296,"context_line":"        self.start_servers(**self.__dict__.copy())"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"        path \u003d \u0027http://%s:%d/v1\u0027 % (\u0027127.0.0.1\u0027, self.api_port)"},{"line_number":299,"context_line":"        http \u003d httplib2.Http()"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2F5pU%3D","line":296,"in_reply_to":"AAAAOn%2F%2F5qM%3D","updated":"2013-04-12 09:46:17.000000000","message":"Flavio, do you also think in that case it should be moved to be a \u0027unit\u0027 test rather than functional?","commit_id":"7e4e0d27b6d9c84b0b2d0d10833c5698231bed71"}],"glance/tests/unit/api/test_common.py":[{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"7d1cdaee9137cbdfbad4188a9d878cc56606231f","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        \"\"\"Establish a clean test environment\"\"\""},{"line_number":138,"context_line":"        super(TestMalformedRequest, self).setUp()"},{"line_number":139,"context_line":"        self.apiv1 \u003d test_utils.FakeAuthMiddleware(APIv1(APIMapper()))"},{"line_number":140,"context_line":"        self.apiv2 \u003d test_utils.FakeAuthMiddleware(APIv2(APIMapper()))"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def test_redirect_incomplete_url(self):"},{"line_number":143,"context_line":"        \"\"\"Test Glance V1 and V2 routers redirect an empty url\"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOn%2F%2F25M%3D","line":140,"updated":"2013-04-17 07:42:21.000000000","message":"Hey,\n\nSince we\u0027re putting this in test_common I think it would be better to just test this using wsgi.Router instead of testing both v1 and v2 routers.\n\nCheers","commit_id":"282b1822fad69f5ed6ec1b9f78327ce98ad1f845"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"ad0f1efae5e2861b4412a5b33c9521e7e9b6514d","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        \"\"\"Establish a clean test environment\"\"\""},{"line_number":138,"context_line":"        super(TestMalformedRequest, self).setUp()"},{"line_number":139,"context_line":"        self.apiv1 \u003d test_utils.FakeAuthMiddleware(APIv1(APIMapper()))"},{"line_number":140,"context_line":"        self.apiv2 \u003d test_utils.FakeAuthMiddleware(APIv2(APIMapper()))"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def test_redirect_incomplete_url(self):"},{"line_number":143,"context_line":"        \"\"\"Test Glance V1 and V2 routers redirect an empty url\"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOn%2F%2F1dM%3D","line":140,"in_reply_to":"AAAAOn%2F%2F1wg%3D","updated":"2013-04-19 07:29:03.000000000","message":"Hey,\n\nI meant something like this.\n\nhttp://paste.openstack.org/show/36364/\n\nTBH, I now think this mapper.connect should be inside wsgi.Router instead of each API\u0027s router. This is something that will be needed in any version of the API, I reckon.\n\nthoughts?","commit_id":"282b1822fad69f5ed6ec1b9f78327ce98ad1f845"},{"author":{"_account_id":6662,"name":"James Li","email":"yueli.m@gmail.com","username":"james-li-3"},"change_message_id":"9309158ddc4657582882405e7f0f30d9df7a3988","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        \"\"\"Establish a clean test environment\"\"\""},{"line_number":138,"context_line":"        super(TestMalformedRequest, self).setUp()"},{"line_number":139,"context_line":"        self.apiv1 \u003d test_utils.FakeAuthMiddleware(APIv1(APIMapper()))"},{"line_number":140,"context_line":"        self.apiv2 \u003d test_utils.FakeAuthMiddleware(APIv2(APIMapper()))"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def test_redirect_incomplete_url(self):"},{"line_number":143,"context_line":"        \"\"\"Test Glance V1 and V2 routers redirect an empty url\"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOn%2F%2F1wg%3D","line":140,"in_reply_to":"AAAAOn%2F%2F25M%3D","updated":"2013-04-18 19:53:02.000000000","message":"Hi Flavio, do you want me to setup a urlmap like the following?\n /v1: apiv1app\n /v2: apiv2app\n\nNot sure how to test the code change in API class of v1 and v2 just using wsgi.Router.","commit_id":"282b1822fad69f5ed6ec1b9f78327ce98ad1f845"},{"author":{"_account_id":177,"name":"Alex Meade","email":"mr.alex.meade@gmail.com","username":"alex-meade"},"change_message_id":"78b94d8fa00208b2e6592cb2b003f54c26f1a3ca","unresolved":false,"context_lines":[{"line_number":20,"context_line":"import glance.api.common"},{"line_number":21,"context_line":"from glance.common import exception"},{"line_number":22,"context_line":"from glance.common.wsgi import APIMapper"},{"line_number":23,"context_line":"from glance.common.wsgi import Router"},{"line_number":24,"context_line":"from glance.tests import utils as test_utils"},{"line_number":25,"context_line":"from glance.tests.unit import base"},{"line_number":26,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOn%2F%2FyB4%3D","line":23,"updated":"2013-04-23 15:54:55.000000000","message":"could you import wsgi here and then do wsgi.Router and wsgi.APIMapper in the code? We discourage importing classes directly since when they are used in the code it is not obvious where they came from.","commit_id":"d0ec137bf5448d1fd43886a248ee6e6836d0fd32"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"8d1aedc7d8c370730da174b1cc13bffba82635aa","unresolved":false,"context_lines":[{"line_number":20,"context_line":"import glance.api.common"},{"line_number":21,"context_line":"from glance.common import exception"},{"line_number":22,"context_line":"from glance.common.wsgi import APIMapper"},{"line_number":23,"context_line":"from glance.common.wsgi import Router"},{"line_number":24,"context_line":"from glance.tests import utils as test_utils"},{"line_number":25,"context_line":"from glance.tests.unit import base"},{"line_number":26,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOn%2F%2FtQI%3D","line":23,"in_reply_to":"AAAAOn%2F%2FyB4%3D","updated":"2013-04-26 19:20:38.000000000","message":"also, it might not work if someone uses a non-static method here inadvertently","commit_id":"d0ec137bf5448d1fd43886a248ee6e6836d0fd32"}]}
