)]}'
{"swift/container/backend.py":[{"author":{"_account_id":7479,"name":"paul luse","email":"paul.e.luse@intel.com","username":"peluse"},"change_message_id":"4f1979f3c6fa21459678e783a107b8fdb838f7a3","unresolved":false,"context_lines":[{"line_number":301,"context_line":"                    else:"},{"line_number":302,"context_line":"                        raise"},{"line_number":303,"context_line":"            data \u003d dict(data)"},{"line_number":304,"context_line":"            # populate instance cache"},{"line_number":305,"context_line":"            self._storage_policy_index \u003d data[\u0027storage_policy_index\u0027]"},{"line_number":306,"context_line":"            return data"},{"line_number":307,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAWH%2F%2Bs%2BQ%3D","line":304,"updated":"2014-03-24 23:49:30.000000000","message":"could you explain this a bit for me?  Kinda sorta follow you but not completely","commit_id":"635b5c417b3eae61dad4302b36bf04638be1ce57"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"e6e8b3a918c95850968e1c10972e7010c25173ba","unresolved":false,"context_lines":[{"line_number":301,"context_line":"                    else:"},{"line_number":302,"context_line":"                        raise"},{"line_number":303,"context_line":"            data \u003d dict(data)"},{"line_number":304,"context_line":"            # populate instance cache"},{"line_number":305,"context_line":"            self._storage_policy_index \u003d data[\u0027storage_policy_index\u0027]"},{"line_number":306,"context_line":"            return data"},{"line_number":307,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAWH%2F%2BkpE%3D","line":304,"in_reply_to":"AAAAWH%2F%2Bs%2BQ%3D","updated":"2014-03-25 20:12:21.000000000","message":"just makes someone going after self.storage_policy_index not have to call get_info again.  Once a db has it\u0027s get_info called the cached value in the instance attribute is always safe.\n\nReminds me I should probably clear it in set_storage_policy_index method...","commit_id":"635b5c417b3eae61dad4302b36bf04638be1ce57"}],"test/unit/container/test_backend.py":[{"author":{"_account_id":7479,"name":"paul luse","email":"paul.e.luse@intel.com","username":"peluse"},"change_message_id":"4f1979f3c6fa21459678e783a107b8fdb838f7a3","unresolved":false,"context_lines":[{"line_number":63,"context_line":"                broker.set_storage_policy_index(policy.idx)"},{"line_number":64,"context_line":"            self.assertEqual(policy.idx, broker.storage_policy_index)"},{"line_number":65,"context_line":"            # make sure it\u0027s cached"},{"line_number":66,"context_line":"            with mock.patch.object(broker, \u0027get\u0027):"},{"line_number":67,"context_line":"                self.assertEqual(policy.idx, broker.storage_policy_index)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def test_exception(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAWH%2F%2Bs5I%3D","line":66,"updated":"2014-03-24 23:49:30.000000000","message":"Not a comment, just yet another educational question for me - not even sure how to ask the question so can you just briefly describe these last 2 lines?","commit_id":"635b5c417b3eae61dad4302b36bf04638be1ce57"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"e6e8b3a918c95850968e1c10972e7010c25173ba","unresolved":false,"context_lines":[{"line_number":63,"context_line":"                broker.set_storage_policy_index(policy.idx)"},{"line_number":64,"context_line":"            self.assertEqual(policy.idx, broker.storage_policy_index)"},{"line_number":65,"context_line":"            # make sure it\u0027s cached"},{"line_number":66,"context_line":"            with mock.patch.object(broker, \u0027get\u0027):"},{"line_number":67,"context_line":"                self.assertEqual(policy.idx, broker.storage_policy_index)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def test_exception(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAWH%2F%2Bkng%3D","line":66,"in_reply_to":"AAAAWH%2F%2Bs5I%3D","updated":"2014-03-25 20:12:21.000000000","message":"I\u0027m swapping out the \u0027get\u0027 method for something that won\u0027t actually be able to read anything from the db (an instance of MagicMock) - then I make sure I can still read the broker\u0027s storage_policy_index attribute - as proof that future attribute access doesn\u0027t need to hit the stats table.\n\nMaybe a bit heavy handed, but seems to test the intent more than the implementation - so I have a (perhaps naive) notion that it\u0027s a less brittle test like this.","commit_id":"635b5c417b3eae61dad4302b36bf04638be1ce57"}],"test/unit/container/test_server.py":[{"author":{"_account_id":7479,"name":"paul luse","email":"paul.e.luse@intel.com","username":"peluse"},"change_message_id":"4f1979f3c6fa21459678e783a107b8fdb838f7a3","unresolved":false,"context_lines":[{"line_number":395,"context_line":""},{"line_number":396,"context_line":"    def test_PUT_no_policy_for_existing_non_default(self):"},{"line_number":397,"context_line":"        ts \u003d itertools.count(1)"},{"line_number":398,"context_line":"        non_default_policy \u003d [p for p in POLICIES if not p.is_default][0]"},{"line_number":399,"context_line":"        # create a container with the non-default storage policy"},{"line_number":400,"context_line":"        req \u003d Request.blank(\u0027/sda1/p/a/c\u0027, method\u003d\u0027PUT\u0027, headers\u003d{"},{"line_number":401,"context_line":"            \u0027X-Timestamp\u0027: normalize_timestamp(ts.next()),"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAWH%2F%2Bs4U%3D","line":398,"updated":"2014-03-24 23:49:30.000000000","message":"sweet","commit_id":"635b5c417b3eae61dad4302b36bf04638be1ce57"}]}
