)]}'
{"trove/tests/unittests/quota/test_quota.py":[{"author":{"_account_id":5390,"name":"Steve Leon","username":"steve-leon","inactive":true},"change_message_id":"c3448a3b06f59b5803e6c8155fb28188cd832e93","unresolved":false,"context_lines":[{"line_number":402,"context_line":"        self.driver.reserve(FAKE_TENANT1, resources, delta)"},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"        for _, kw in Reservation.create.call_args_list:"},{"line_number":405,"context_line":"            self.assertEqual(kw[\u0027usage_id\u0027] + 1, kw[\u0027delta\u0027])"},{"line_number":406,"context_line":"            self.assertEqual(Reservation.Statuses.RESERVED, kw[\u0027status\u0027])"},{"line_number":407,"context_line":""},{"line_number":408,"context_line":"    def test_reserve_resource_unknown(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_c7830501","line":405,"updated":"2014-08-29 21:58:35.000000000","message":"There is no relationship between the usage_id and the delta. The reason this works is because i am using a delta of 2 instances and 1 volume. The usage_id is just an id that i get when i create the model (it is an int but it could be a GUID as well)\nSo having this assert is implying a relationship. It does look cleaner but i rather have two separate assert calls.","commit_id":"87c0aca88ec28a0f7e2026c27261f97403394dd2"},{"author":{"_account_id":5293,"name":"Nikhil","email":"SlickNik@gmail.com","username":"slicknik"},"change_message_id":"127402188b581c66d7746e1c23f30223ca1e41ad","unresolved":false,"context_lines":[{"line_number":402,"context_line":"        self.driver.reserve(FAKE_TENANT1, resources, delta)"},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"        for _, kw in Reservation.create.call_args_list:"},{"line_number":405,"context_line":"            self.assertEqual(kw[\u0027usage_id\u0027] + 1, kw[\u0027delta\u0027])"},{"line_number":406,"context_line":"            self.assertEqual(Reservation.Statuses.RESERVED, kw[\u0027status\u0027])"},{"line_number":407,"context_line":""},{"line_number":408,"context_line":"    def test_reserve_resource_unknown(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_680afcd3","line":405,"in_reply_to":"1abeadc6_27e3d9a4","updated":"2014-08-31 19:01:45.000000000","message":"We\u0027re now using a random HASHSEED value, which means that the order of the reservations in the list above is non-deterministic, which makes checking the deltas problematic. As a solution, the unit test sets up the values for the deltas, so that after the reservations call the deltas should be the same as the usage_id. That way it\u0027s much simpler to loop through the reservations and assert this for each element in the list.\n\nI\u0027ll add a comment to the test to make this clear -- you\u0027re right that it\u0027s less than obvious when looking at the code.\n\nThanks!","commit_id":"87c0aca88ec28a0f7e2026c27261f97403394dd2"},{"author":{"_account_id":5390,"name":"Steve Leon","username":"steve-leon","inactive":true},"change_message_id":"a8ff0a1dfd79f23b1fe3f230c44d4502fe7043ff","unresolved":false,"context_lines":[{"line_number":402,"context_line":"        self.driver.reserve(FAKE_TENANT1, resources, delta)"},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"        for _, kw in Reservation.create.call_args_list:"},{"line_number":405,"context_line":"            self.assertEqual(kw[\u0027usage_id\u0027] + 1, kw[\u0027delta\u0027])"},{"line_number":406,"context_line":"            self.assertEqual(Reservation.Statuses.RESERVED, kw[\u0027status\u0027])"},{"line_number":407,"context_line":""},{"line_number":408,"context_line":"    def test_reserve_resource_unknown(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1abeadc6_27e3d9a4","line":405,"in_reply_to":"1abeadc6_c7830501","updated":"2014-08-29 22:01:41.000000000","message":"One thing you can do is to add a comment saying that that there is no relationship between the two variables and the assert assuming that the connection is because it knows what the previous values were.","commit_id":"87c0aca88ec28a0f7e2026c27261f97403394dd2"}]}
