)]}'
{"swiftclient/client.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"6eb845a7380c2644caec8d5012b282e788500fe6","unresolved":false,"context_lines":[{"line_number":885,"context_line":"                return resp.read(length)"},{"line_number":886,"context_line":""},{"line_number":887,"context_line":"            def __iter__(self):"},{"line_number":888,"context_line":"                return self.chunk()"},{"line_number":889,"context_line":""},{"line_number":890,"context_line":"        object_body \u003d _object_body()"},{"line_number":891,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba7be1f8_1b4cef41","line":888,"updated":"2015-03-02 20:22:30.000000000","message":"no, wait, that\u0027s not right is it?\n\nThe caller isn\u0027t expecting to have to call iter on the return value - it should just be able to start calling next...","commit_id":"7a9d93504944d9404e084be906fde071e5390f0a"},{"author":{"_account_id":8542,"name":"Prashanth Pai","email":"ppai@redhat.com","username":"pai"},"change_message_id":"6c9bfda7e796db9f824a9ac3df5af5fc13c9f3e7","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        self.resp \u003d resp"},{"line_number":154,"context_line":"        self.chunk_size \u003d chunk_size"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    def read(self, length\u003dNone):"},{"line_number":157,"context_line":"        return self.resp.read(length)"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def __iter__(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a80dd14_62bc25dd","line":156,"updated":"2015-03-09 05:36:51.000000000","message":"Just a suggestion: you may want to consider the behavior similar to read() method in file operations i.e \"When size is omitted or negative, the entire contents of the file will be read and returned\"\n\nhttps://docs.python.org/2/tutorial/inputoutput.html#methods-of-file-objects","commit_id":"3da65a8ba0f5f10fc5b670b8410da91ef25f6d87"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"59c619227ee05b533c13abb4610fd697a8a124fa","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        self.resp \u003d resp"},{"line_number":154,"context_line":"        self.chunk_size \u003d chunk_size"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    def read(self, length\u003dNone):"},{"line_number":157,"context_line":"        return self.resp.read(length)"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def __iter__(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a80dd14_886bf31c","line":156,"in_reply_to":"9a80dd14_62bc25dd","updated":"2015-03-09 10:22:41.000000000","message":"Thanks Prashanth.\n\nMy understanding of the behaviour is actually to read the remainder of the file -- ie if you have not read any of the contents the whole file will be returned, if you have already read some contents of the file then the rest of the file will be returned.\n\nThis is implied in the link you reference: \u0027If the end of the file has been reached, f.read() will return an empty string (\"\").\u0027\n\nWe match that behaviour and test for it with a new test in this patch set: see test_download_object in test_swiftclient.py.","commit_id":"3da65a8ba0f5f10fc5b670b8410da91ef25f6d87"},{"author":{"_account_id":8542,"name":"Prashanth Pai","email":"ppai@redhat.com","username":"pai"},"change_message_id":"36d95c82bcff9438762e6c339afcc1b7bb66a344","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        self.resp \u003d resp"},{"line_number":154,"context_line":"        self.chunk_size \u003d chunk_size"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    def read(self, length\u003dNone):"},{"line_number":157,"context_line":"        return self.resp.read(length)"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def __iter__(self):"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a80dd14_53eb6c77","line":156,"in_reply_to":"9a80dd14_886bf31c","updated":"2015-03-09 10:54:04.000000000","message":"Ah, I see. Thanks!","commit_id":"3da65a8ba0f5f10fc5b670b8410da91ef25f6d87"}],"tests/functional/test_swiftclient.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"6eb845a7380c2644caec8d5012b282e788500fe6","unresolved":false,"context_lines":[{"line_number":255,"context_line":"        hdrs, body \u003d self.conn.get_object("},{"line_number":256,"context_line":"            self.containername, self.objectname,"},{"line_number":257,"context_line":"            resp_chunk_size\u003d10)"},{"line_number":258,"context_line":"        self.assertTrue(hasattr(body, \u0027__iter__\u0027))"},{"line_number":259,"context_line":"        self.assertEqual(self.test_data, b\u0027\u0027.join(body))"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"    def test_post_account(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba7be1f8_3edb617d","line":258,"updated":"2015-03-02 20:22:30.000000000","message":"I\u0027m not sure this is strictly equivalent.  I think generator\u0027s do have an __iter__, but it\u0027s just an identity function.\n\nGenerators are already iterators - as opposed a something that is an iter*able* meaning you can *convert* it to an iterator.\n\nThe contract was that the returned value *is* an iterator (you can call next on it) not an iterable (you call __iter__ on it)","commit_id":"7a9d93504944d9404e084be906fde071e5390f0a"}],"tests/unit/test_swiftclient.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"6eb845a7380c2644caec8d5012b282e788500fe6","unresolved":false,"context_lines":[{"line_number":660,"context_line":"        f \u003d StubBody(\u0027abcde\u0027)"},{"line_number":661,"context_line":"        with mock.patch(\u0027swiftclient.client.get_auth_1_0\u0027) as mock_get_auth:"},{"line_number":662,"context_line":"            mock_get_auth.return_value \u003d (\u0027http://auth.url/\u0027, \u0027tToken\u0027)"},{"line_number":663,"context_line":"            c.http_connection \u003d self.fake_http_connection(200, body\u003df)"},{"line_number":664,"context_line":"            __, resp \u003d conn.get_object(\u0027asdf\u0027, \u0027asdf\u0027)"},{"line_number":665,"context_line":"            self.assertTrue(hasattr(resp, \u0027read\u0027))"},{"line_number":666,"context_line":"            self.assertEquals(resp.read(3), \u0027abc\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba7be1f8_5e52d5de","line":663,"updated":"2015-03-02 20:22:30.000000000","message":"this seems weird, you\u0027re forcing the http mock to return a fake that acts like the thing you expect the UUT to create instead of the readable it\u0027s actually going to return?","commit_id":"7a9d93504944d9404e084be906fde071e5390f0a"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"6eb845a7380c2644caec8d5012b282e788500fe6","unresolved":false,"context_lines":[{"line_number":661,"context_line":"        with mock.patch(\u0027swiftclient.client.get_auth_1_0\u0027) as mock_get_auth:"},{"line_number":662,"context_line":"            mock_get_auth.return_value \u003d (\u0027http://auth.url/\u0027, \u0027tToken\u0027)"},{"line_number":663,"context_line":"            c.http_connection \u003d self.fake_http_connection(200, body\u003df)"},{"line_number":664,"context_line":"            __, resp \u003d conn.get_object(\u0027asdf\u0027, \u0027asdf\u0027)"},{"line_number":665,"context_line":"            self.assertTrue(hasattr(resp, \u0027read\u0027))"},{"line_number":666,"context_line":"            self.assertEquals(resp.read(3), \u0027abc\u0027)"},{"line_number":667,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"ba7be1f8_bed6714d","line":664,"updated":"2015-03-02 20:22:30.000000000","message":"why doesn\u0027t this pass in resp_chunk_size?","commit_id":"7a9d93504944d9404e084be906fde071e5390f0a"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"3c7083779f7d301188f9ac0e72f95ba884cb00ee","unresolved":false,"context_lines":[{"line_number":663,"context_line":"            __, resp \u003d conn.get_object(\u0027asdf\u0027, \u0027asdf\u0027, resp_chunk_size\u003d3)"},{"line_number":664,"context_line":"            self.assertTrue(hasattr(resp, \u0027read\u0027))"},{"line_number":665,"context_line":"            self.assertEquals(resp.read(3), \u0027abc\u0027)"},{"line_number":666,"context_line":"            self.assertEquals(next(resp), \u0027de\u0027)"},{"line_number":667,"context_line":""},{"line_number":668,"context_line":"    def test_chunk_size_iter(self):"},{"line_number":669,"context_line":"        conn \u003d c.Connection(\u0027http://auth.url/\u0027, \u0027some_user\u0027, \u0027some_key\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a80dd14_de6f45fa","line":666,"updated":"2015-03-10 00:10:20.000000000","message":"Seeing as this method is suppose to test the read method, I think rather then using next() you should use read:\n\n  self.assertTrue(hasattr(resp, \u0027read\u0027))\n  self.assertEquals(resp.read(3), \u0027abc\u0027)\n  self.assertEquals(resp.read(), \u0027de\u0027)\n\nThat way we cover the edge case of None, and just another read method test.","commit_id":"3da65a8ba0f5f10fc5b670b8410da91ef25f6d87"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"9c987e00df4b13f051e7a14b098da0bfe0cbc9ac","unresolved":false,"context_lines":[{"line_number":663,"context_line":"            __, resp \u003d conn.get_object(\u0027asdf\u0027, \u0027asdf\u0027, resp_chunk_size\u003d3)"},{"line_number":664,"context_line":"            self.assertTrue(hasattr(resp, \u0027read\u0027))"},{"line_number":665,"context_line":"            self.assertEquals(resp.read(3), \u0027abc\u0027)"},{"line_number":666,"context_line":"            self.assertEquals(next(resp), \u0027de\u0027)"},{"line_number":667,"context_line":""},{"line_number":668,"context_line":"    def test_chunk_size_iter(self):"},{"line_number":669,"context_line":"        conn \u003d c.Connection(\u0027http://auth.url/\u0027, \u0027some_user\u0027, \u0027some_key\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a80dd14_9d430a6b","line":666,"in_reply_to":"9a80dd14_de6f45fa","updated":"2015-03-10 06:32:45.000000000","message":"I\u0027m not sure there\u0027s a missed case here or not - I think the functional tests cover some of it.  That\u0027s my bad on throwing crap tests over the wall.\n\nAnyway, if you take another stab at the unittests I think it\u0027d be nice to *also* cover the mixed read/iter and iter/read cases as well.","commit_id":"3da65a8ba0f5f10fc5b670b8410da91ef25f6d87"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"3c7083779f7d301188f9ac0e72f95ba884cb00ee","unresolved":false,"context_lines":[{"line_number":673,"context_line":"            __, resp \u003d conn.get_object(\u0027asdf\u0027, \u0027asdf\u0027, resp_chunk_size\u003d3)"},{"line_number":674,"context_line":"            self.assertTrue(hasattr(resp, \u0027next\u0027))"},{"line_number":675,"context_line":"            self.assertEquals(next(resp), \u0027abc\u0027)"},{"line_number":676,"context_line":"            self.assertEquals(resp.read(), \u0027de\u0027)"},{"line_number":677,"context_line":""},{"line_number":678,"context_line":""},{"line_number":679,"context_line":"class TestHeadObject(MockHttpTest):"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a80dd14_3e578127","line":676,"updated":"2015-03-10 00:10:20.000000000","message":"And then use next() here to prove that it\u0027ll only get 2 characters even though the resp_chunk_size is 3.\n\n  self.assertTrue(hasattr(resp, \u0027next\u0027))\n  self.assertEquals(next(resp), \u0027abc\u0027)\n  self.assertEquals(next(resp), \u0027de\u0027)","commit_id":"3da65a8ba0f5f10fc5b670b8410da91ef25f6d87"}],"tests/unit/utils.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"6eb845a7380c2644caec8d5012b282e788500fe6","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        return len(self.data)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def __getitem__(self, *args):"},{"line_number":84,"context_line":"        return self"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def read(self, length):"},{"line_number":87,"context_line":"        return self.data[:length]"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba7be1f8_5e0015ab","line":84,"updated":"2015-03-02 20:22:30.000000000","message":"wat?","commit_id":"7a9d93504944d9404e084be906fde071e5390f0a"}]}
