)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"2cd28c301e0f7c081203bb2b63450c669c80a161","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Do not use matchers for trivial assertions"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Current cases are covered by assertEqual(.., len(..)) and assertIn"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: Ibfb691ac3e8cb409d3873648439719c965ed95fa"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9a1a9d01_dc3fd823","line":9,"updated":"2015-09-25 11:03:58.000000000","message":"Why?\n\nWhile I think the patch is fine, I think we are missing the reason why we should not use matchers for such assertions.\n\nAFAIR, the use of HasLength was suggested to us by @lifeless* long time ago as the right way to do it.\n\nNote*: Sorry if it wasn\u0027t the case","commit_id":"8a97071ceee6c2a5f8712e01f7160b2cd426fb55"},{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"b682726487eec5a1c04ca1b28a9890beadd8b8f5","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Do not use matchers for trivial assertions"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Current cases are covered by assertEqual(.., len(..)) and assertIn"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: Ibfb691ac3e8cb409d3873648439719c965ed95fa"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9a1a9d01_6d5ed377","line":9,"in_reply_to":"9a1a9d01_dc3fd823","updated":"2015-09-28 15:11:57.000000000","message":"Lucas, I might be wrong is some details, but to me the picture looks the following:\n\ntesttools was created as a single testing framework that could be used on all supported Python versions at that moment, since Py26 was lacking an advanced enough unittest framework in the standard library. It also has some nice capabilities as test runner, but that is orthogonal to unit tests themselves.\n\nSince we do not support Py26 already, using testtools just brings an extra overhead, and in my opinion it should be used only when its (really useful) advanced features are needed, like creating complex matchers that are absent from unittest in stdlib.\n\nIn fact I would be two hands up for rewriting unit tests for all service components of openstack to use built-in unittest.TestCase as base case for unit tests, and use testtools only when really needed, as apart from creating complex matchers, currently I do not see any advantages of it in comparison to what\u0027s in stdlib for Py27 and Py3. Unfortunately this would have a very considerable coding overhead, mostly due to difference in assertRaises (testtools returns the exception object, unittest returns a context manager instead) that is used quite a lot all over unit tests.\n\nIn any way, let\u0027s use the Python stdlib as much as possible :)","commit_id":"8a97071ceee6c2a5f8712e01f7160b2cd426fb55"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"cd3c06b37f28848c1d97c74e4a878139778a2f07","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Do not use matchers for trivial assertions"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Current cases are covered by assertEqual(.., len(..)) and assertIn"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: Ibfb691ac3e8cb409d3873648439719c965ed95fa"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9a1a9d01_098f0ccd","line":9,"updated":"2015-10-05 13:00:13.000000000","message":"Thanks for the explanation on the previous patch-set, I think it would be important to put some of it here. We should register in the commit message the reasoning for doing something.","commit_id":"bd189e4f3763b85071d29c97a1ce34febf406667"}],"ironic/tests/api/v1/test_drivers.py":[{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"20b0e25a90d98c4fa2039192e2c2a9dd726f3aa6","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def test_drivers_no_active_conductor(self):"},{"line_number":62,"context_line":"        data \u003d self.get_json(\u0027/drivers\u0027)"},{"line_number":63,"context_line":"        self.assertEqual(0, len(data[\u0027drivers\u0027]))"},{"line_number":64,"context_line":"        self.assertEqual([], data[\u0027drivers\u0027])"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    def test_drivers_get_one_ok(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a1a9d01_5669858a","line":63,"updated":"2015-09-24 16:34:54.000000000","message":"Actually, I prefer assertEqual(0, len()) because it is both more explicit about what it is testing, and it is more consistent with the assertions in other adjascent test cases.\n\nif an assertFalse(data[\u0027drivers\u0027]) fails here, the error message will not be as immediately obvious about what the expected behavior was. Should data[\u0027drivers\u0027] be True? 1? some other value?","commit_id":"8a97071ceee6c2a5f8712e01f7160b2cd426fb55"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"7c38f4468521e41bbbdd8abe3fb998568e968a18","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def test_drivers_no_active_conductor(self):"},{"line_number":62,"context_line":"        data \u003d self.get_json(\u0027/drivers\u0027)"},{"line_number":63,"context_line":"        self.assertEqual(0, len(data[\u0027drivers\u0027]))"},{"line_number":64,"context_line":"        self.assertEqual([], data[\u0027drivers\u0027])"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    def test_drivers_get_one_ok(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_69e14a9a","line":63,"updated":"2015-09-19 19:21:44.000000000","message":"nit: self.assertFalse(data[\u0027drivers\u0027])","commit_id":"8a97071ceee6c2a5f8712e01f7160b2cd426fb55"}],"ironic/tests/api/v1/test_nodes.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"7c38f4468521e41bbbdd8abe3fb998568e968a18","unresolved":false,"context_lines":[{"line_number":515,"context_line":""},{"line_number":516,"context_line":"        data \u003d self.get_json(\u0027/nodes?instance_uuid\u003d%s\u0027 % wrong_uuid)"},{"line_number":517,"context_line":""},{"line_number":518,"context_line":"        self.assertEqual(0, len(data[\u0027nodes\u0027]))"},{"line_number":519,"context_line":""},{"line_number":520,"context_line":"    def test_node_by_instance_uuid_invalid_uuid(self):"},{"line_number":521,"context_line":"        response \u003d self.get_json(\u0027/nodes?instance_uuid\u003dfake\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_49e486ab","line":518,"updated":"2015-09-19 19:21:44.000000000","message":"ditto","commit_id":"8a97071ceee6c2a5f8712e01f7160b2cd426fb55"}],"ironic/tests/api/v1/test_ports.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"7c38f4468521e41bbbdd8abe3fb998568e968a18","unresolved":false,"context_lines":[{"line_number":235,"context_line":"    def test_port_by_address_non_existent_address(self):"},{"line_number":236,"context_line":"        # non-existent address"},{"line_number":237,"context_line":"        data \u003d self.get_json(\u0027/ports?address\u003d%s\u0027 % \u0027aa:bb:cc:dd:ee:ff\u0027)"},{"line_number":238,"context_line":"        self.assertEqual(0, len(data[\u0027ports\u0027]))"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def test_port_by_address_invalid_address_format(self):"},{"line_number":241,"context_line":"        obj_utils.create_test_port(self.context, node_id\u003dself.node.id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_09ed2e8e","line":238,"updated":"2015-09-19 19:21:44.000000000","message":"ditto","commit_id":"8a97071ceee6c2a5f8712e01f7160b2cd426fb55"}],"ironic/tests/common/test_hash_ring.py":[{"author":{"_account_id":9315,"name":"ramesh","email":"rameshg87@gmail.com","username":"rameshg87"},"change_message_id":"3d3afb8b500aa8ad9141b3e361c62380dd4c0250","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        self.assertIn("},{"line_number":114,"context_line":"            ring.get_hosts(\u0027fake\u0027, ignore_hosts\u003d[\u0027foo\u0027]),"},{"line_number":115,"context_line":"            bar_or_baz)"},{"line_number":116,"context_line":"        self.assertIn("},{"line_number":117,"context_line":"            ring.get_hosts(\u0027fake\u0027, ignore_hosts\u003d[\u0027foo\u0027, \u0027bar\u0027]),"},{"line_number":118,"context_line":"            bar_or_baz)"},{"line_number":119,"context_line":"        self.assertEqual([], ring.get_hosts(\u0027fake\u0027, ignore_hosts\u003dhosts))"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_028e6b27","line":116,"updated":"2015-09-19 04:47:23.000000000","message":"Can this be\n\n  self.assertEqual([\u0027baz\u0027], ring.get_hosts(\u0027fake\u0027, ignore_hosts\u003d[\u0027foo\u0027, \u0027bar\u0027]))","commit_id":"8a97071ceee6c2a5f8712e01f7160b2cd426fb55"}],"ironic/tests/unit/api/v1/test_drivers.py":[{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"ae5da30543de3d418dc4463740d2beb22802401e","unresolved":false,"context_lines":[{"line_number":49,"context_line":"            {\u0027name\u0027: self.d2, \u0027hosts\u0027: [self.h1, self.h2]},"},{"line_number":50,"context_line":"        ], key\u003dlambda d: d[\u0027name\u0027])"},{"line_number":51,"context_line":"        data \u003d self.get_json(\u0027/drivers\u0027)"},{"line_number":52,"context_line":"        self.assertEqual(2, len(data[\u0027drivers\u0027]))"},{"line_number":53,"context_line":"        drivers \u003d sorted(data[\u0027drivers\u0027], key\u003dlambda d: d[\u0027name\u0027])"},{"line_number":54,"context_line":"        for i in range(len(expected)):"},{"line_number":55,"context_line":"            d \u003d drivers[i]"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_2a51abd8","line":52,"updated":"2015-10-05 07:31:36.000000000","message":"This is strictly worse when it fails:\n\n1 !\u003d 0 \n\nvs seeing the actual content. So it doesn\u0027t make sense to me at all. Whats the motivation for this?","commit_id":"bd189e4f3763b85071d29c97a1ce34febf406667"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"ae5da30543de3d418dc4463740d2beb22802401e","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def test_drivers_no_active_conductor(self):"},{"line_number":62,"context_line":"        data \u003d self.get_json(\u0027/drivers\u0027)"},{"line_number":63,"context_line":"        self.assertEqual(0, len(data[\u0027drivers\u0027]))"},{"line_number":64,"context_line":"        self.assertEqual([], data[\u0027drivers\u0027])"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    @mock.patch.object(rpcapi.ConductorAPI, \u0027get_driver_properties\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_ca5eefe8","line":63,"updated":"2015-10-05 07:31:36.000000000","message":"Ditto.","commit_id":"bd189e4f3763b85071d29c97a1ce34febf406667"}]}
