)]}'
{"cyborg/tests/unit/objects/test_device.py":[{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"6bef7bb729a3279b9221b548ba6995ca64b020fc","unresolved":false,"context_lines":[{"line_number":44,"context_line":"            mock_device_get.assert_called_once_with(self.context, device_id)"},{"line_number":45,"context_line":"            self.assertEqual(self.context, device._context)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def test_get_by_hostname(self):"},{"line_number":48,"context_line":"        hostname \u003d self.fake_device[\u0027hostname\u0027]"},{"line_number":49,"context_line":"        dev_filter \u003d {\u0027hostname\u0027: hostname}"},{"line_number":50,"context_line":"        with mock.patch.object(objects.Device, \u0027list\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_bb16e6f1","line":47,"updated":"2019-12-20 03:58:51.000000000","message":"Would be good to have another test if hostname is None or \u0027\u0027. Then it should return [].","commit_id":"ba3cee1ec72da48d83a1c8e13f9afc1d61b991bb"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"eca5358042fff57adb399d99a9cd00daaca6a185","unresolved":false,"context_lines":[{"line_number":44,"context_line":"            mock_device_get.assert_called_once_with(self.context, device_id)"},{"line_number":45,"context_line":"            self.assertEqual(self.context, device._context)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def test_get_by_hostname(self):"},{"line_number":48,"context_line":"        hostname \u003d self.fake_device[\u0027hostname\u0027]"},{"line_number":49,"context_line":"        dev_filter \u003d {\u0027hostname\u0027: hostname}"},{"line_number":50,"context_line":"        with mock.patch.object(objects.Device, \u0027list\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_17025f73","line":47,"in_reply_to":"3fa7e38b_bb16e6f1","updated":"2019-12-21 02:47:47.000000000","message":"Done","commit_id":"ba3cee1ec72da48d83a1c8e13f9afc1d61b991bb"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"4b9ccc12b57782daebd22fb9926359845f934e24","unresolved":false,"context_lines":[{"line_number":44,"context_line":"            mock_device_get.assert_called_once_with(self.context, device_id)"},{"line_number":45,"context_line":"            self.assertEqual(self.context, device._context)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def test_get_by_hostname(self):"},{"line_number":48,"context_line":"        hostname \u003d self.fake_device[\u0027hostname\u0027]"},{"line_number":49,"context_line":"        dev_filter \u003d {\u0027hostname\u0027: hostname}"},{"line_number":50,"context_line":"        with mock.patch.object(objects.Device, \u0027list\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_57d697f4","line":47,"in_reply_to":"3fa7e38b_bb16e6f1","updated":"2019-12-21 02:47:30.000000000","message":"Ye. When the hostname doesn\u0027t exists. It should return [].","commit_id":"ba3cee1ec72da48d83a1c8e13f9afc1d61b991bb"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"e5a19843543b238fd02fea930ed99ef7af1e9def","unresolved":false,"context_lines":[{"line_number":61,"context_line":"                hostname,"},{"line_number":62,"context_line":"                attach_handles[0][\u0027hostname\u0027])"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"            # test objects.Device.list return []."},{"line_number":65,"context_line":"            mock_device_list.return_value \u003d []"},{"line_number":66,"context_line":"            hostname \u003d \u0027fake_hostname\u0027"},{"line_number":67,"context_line":"            dev_filter \u003d {\u0027hostname\u0027: hostname}"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_ed26d667","line":64,"updated":"2019-12-21 17:13:09.000000000","message":"Some reviewers may expect each test to be its own test case. Esp. if it involves reset_mock(), but this one does not. I\u0027ll let others comment on this.","commit_id":"ecd9bc527518298a3cba9512a807cd70bef33acf"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"8d0fb6b9493347830f65a8b2ff6610561a0e8550","unresolved":false,"context_lines":[{"line_number":61,"context_line":"                hostname,"},{"line_number":62,"context_line":"                attach_handles[0][\u0027hostname\u0027])"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"            # test objects.Device.list return []."},{"line_number":65,"context_line":"            mock_device_list.return_value \u003d []"},{"line_number":66,"context_line":"            hostname \u003d \u0027fake_hostname\u0027"},{"line_number":67,"context_line":"            dev_filter \u003d {\u0027hostname\u0027: hostname}"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_e1049d16","line":64,"in_reply_to":"3fa7e38b_ed26d667","updated":"2019-12-23 02:40:47.000000000","message":"Agree. each test has it\u0027s own test case will be more clear. will update it. Thanks.","commit_id":"ecd9bc527518298a3cba9512a807cd70bef33acf"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"3be0a8f6b32e4d8a085b78d61d263b47dced5027","unresolved":false,"context_lines":[{"line_number":61,"context_line":"                hostname,"},{"line_number":62,"context_line":"                attach_handles[0][\u0027hostname\u0027])"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"            # test objects.Device.list return []."},{"line_number":65,"context_line":"            mock_device_list.return_value \u003d []"},{"line_number":66,"context_line":"            hostname \u003d \u0027fake_hostname\u0027"},{"line_number":67,"context_line":"            dev_filter \u003d {\u0027hostname\u0027: hostname}"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_c132c1f3","line":64,"in_reply_to":"3fa7e38b_ed26d667","updated":"2019-12-23 02:50:36.000000000","message":"Done","commit_id":"ecd9bc527518298a3cba9512a807cd70bef33acf"},{"author":{"_account_id":21672,"name":"Sundar Nadathur","email":"sundar.nadathur@intel.com","username":"nsundar"},"change_message_id":"e5a19843543b238fd02fea930ed99ef7af1e9def","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            dev_filter \u003d {\u0027hostname\u0027: hostname}"},{"line_number":68,"context_line":"            attach_handles \u003d objects.Device.get_list_by_hostname("},{"line_number":69,"context_line":"                self.context, hostname)"},{"line_number":70,"context_line":"            mock_device_list.assert_called_with("},{"line_number":71,"context_line":"                self.context, dev_filter)"},{"line_number":72,"context_line":"            self.assertEqual([], attach_handles)"},{"line_number":73,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_8d1de211","line":70,"updated":"2019-12-21 17:13:09.000000000","message":"I think assert_called_once_with() will fail here, because the mock has history which has not been cleared. A reset_mock() will clear that history.","commit_id":"ecd9bc527518298a3cba9512a807cd70bef33acf"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"3be0a8f6b32e4d8a085b78d61d263b47dced5027","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            dev_filter \u003d {\u0027hostname\u0027: hostname}"},{"line_number":68,"context_line":"            attach_handles \u003d objects.Device.get_list_by_hostname("},{"line_number":69,"context_line":"                self.context, hostname)"},{"line_number":70,"context_line":"            mock_device_list.assert_called_with("},{"line_number":71,"context_line":"                self.context, dev_filter)"},{"line_number":72,"context_line":"            self.assertEqual([], attach_handles)"},{"line_number":73,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_61318ded","line":70,"in_reply_to":"3fa7e38b_8d1de211","updated":"2019-12-23 02:50:36.000000000","message":"Done","commit_id":"ecd9bc527518298a3cba9512a807cd70bef33acf"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"8d0fb6b9493347830f65a8b2ff6610561a0e8550","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            dev_filter \u003d {\u0027hostname\u0027: hostname}"},{"line_number":68,"context_line":"            attach_handles \u003d objects.Device.get_list_by_hostname("},{"line_number":69,"context_line":"                self.context, hostname)"},{"line_number":70,"context_line":"            mock_device_list.assert_called_with("},{"line_number":71,"context_line":"                self.context, dev_filter)"},{"line_number":72,"context_line":"            self.assertEqual([], attach_handles)"},{"line_number":73,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_86fe1f04","line":70,"in_reply_to":"3fa7e38b_8d1de211","updated":"2019-12-23 02:40:47.000000000","message":"Ye. Actually it call twice. So I just use assert_called_with instead of assert_called_once_with.","commit_id":"ecd9bc527518298a3cba9512a807cd70bef33acf"},{"author":{"_account_id":24872,"name":"YumengBao","email":"yumeng_bao@yahoo.com","username":"Yumeng_Bao"},"change_message_id":"a86e8aa8cdb9bdd91569146e5386dabd92b0f07e","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        with mock.patch.object(objects.Device, \u0027list\u0027,"},{"line_number":54,"context_line":"                               autospec\u003dTrue) as mock_device_list:"},{"line_number":55,"context_line":"            mock_device_list.return_value \u003d [self.fake_device]"},{"line_number":56,"context_line":"            attach_handles \u003d objects.Device.get_list_by_hostname("},{"line_number":57,"context_line":"                self.context, hostname)"},{"line_number":58,"context_line":"            mock_device_list.assert_called_once_with("},{"line_number":59,"context_line":"                self.context, dev_filter)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_9e216aff","line":56,"range":{"start_line":56,"start_character":11,"end_line":56,"end_character":26},"updated":"2019-12-30 02:17:17.000000000","message":"Rename it. attach_handles here will bring confusion.","commit_id":"f9e45edca30d804dd371e8cc05883386c1508033"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"126e2f723b6f0a82ab04316414b08b94f9d40ed8","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        with mock.patch.object(objects.Device, \u0027list\u0027,"},{"line_number":54,"context_line":"                               autospec\u003dTrue) as mock_device_list:"},{"line_number":55,"context_line":"            mock_device_list.return_value \u003d [self.fake_device]"},{"line_number":56,"context_line":"            attach_handles \u003d objects.Device.get_list_by_hostname("},{"line_number":57,"context_line":"                self.context, hostname)"},{"line_number":58,"context_line":"            mock_device_list.assert_called_once_with("},{"line_number":59,"context_line":"                self.context, dev_filter)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_3eddd6dd","line":56,"range":{"start_line":56,"start_character":11,"end_line":56,"end_character":26},"in_reply_to":"3fa7e38b_9e216aff","updated":"2019-12-30 02:42:39.000000000","message":"Done","commit_id":"f9e45edca30d804dd371e8cc05883386c1508033"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"4fdccf6f377375443b8cbe5ccc12ffedd67f851c","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        with mock.patch.object(objects.Device, \u0027list\u0027,"},{"line_number":54,"context_line":"                               autospec\u003dTrue) as mock_device_list:"},{"line_number":55,"context_line":"            mock_device_list.return_value \u003d [self.fake_device]"},{"line_number":56,"context_line":"            attach_handles \u003d objects.Device.get_list_by_hostname("},{"line_number":57,"context_line":"                self.context, hostname)"},{"line_number":58,"context_line":"            mock_device_list.assert_called_once_with("},{"line_number":59,"context_line":"                self.context, dev_filter)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_9e4f2abd","line":56,"range":{"start_line":56,"start_character":11,"end_line":56,"end_character":26},"in_reply_to":"3fa7e38b_9e216aff","updated":"2019-12-30 02:32:02.000000000","message":"Good catch. Thanks. Will fix it.","commit_id":"f9e45edca30d804dd371e8cc05883386c1508033"},{"author":{"_account_id":24872,"name":"YumengBao","email":"yumeng_bao@yahoo.com","username":"Yumeng_Bao"},"change_message_id":"a86e8aa8cdb9bdd91569146e5386dabd92b0f07e","unresolved":false,"context_lines":[{"line_number":59,"context_line":"                self.context, dev_filter)"},{"line_number":60,"context_line":"            self.assertEqual("},{"line_number":61,"context_line":"                hostname,"},{"line_number":62,"context_line":"                attach_handles[0][\u0027hostname\u0027])"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        with mock.patch.object(objects.Device, \u0027list\u0027,"},{"line_number":65,"context_line":"                               autospec\u003dTrue) as mock_device_list:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_3e1ab6c6","line":62,"range":{"start_line":62,"start_character":16,"end_line":62,"end_character":30},"updated":"2019-12-30 02:17:17.000000000","message":"ditto","commit_id":"f9e45edca30d804dd371e8cc05883386c1508033"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"126e2f723b6f0a82ab04316414b08b94f9d40ed8","unresolved":false,"context_lines":[{"line_number":59,"context_line":"                self.context, dev_filter)"},{"line_number":60,"context_line":"            self.assertEqual("},{"line_number":61,"context_line":"                hostname,"},{"line_number":62,"context_line":"                attach_handles[0][\u0027hostname\u0027])"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        with mock.patch.object(objects.Device, \u0027list\u0027,"},{"line_number":65,"context_line":"                               autospec\u003dTrue) as mock_device_list:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_5eda12e6","line":62,"range":{"start_line":62,"start_character":16,"end_line":62,"end_character":30},"in_reply_to":"3fa7e38b_3e1ab6c6","updated":"2019-12-30 02:42:39.000000000","message":"Done","commit_id":"f9e45edca30d804dd371e8cc05883386c1508033"},{"author":{"_account_id":24872,"name":"YumengBao","email":"yumeng_bao@yahoo.com","username":"Yumeng_Bao"},"change_message_id":"a86e8aa8cdb9bdd91569146e5386dabd92b0f07e","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            mock_device_list.return_value \u003d []"},{"line_number":68,"context_line":"            hostname \u003d None"},{"line_number":69,"context_line":"            dev_filter \u003d {\u0027hostname\u0027: hostname}"},{"line_number":70,"context_line":"            attach_handles \u003d objects.Device.get_list_by_hostname("},{"line_number":71,"context_line":"                self.context, hostname)"},{"line_number":72,"context_line":"            mock_device_list.assert_called_once_with("},{"line_number":73,"context_line":"                self.context, dev_filter)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_5e17729e","line":70,"range":{"start_line":70,"start_character":12,"end_line":70,"end_character":26},"updated":"2019-12-30 02:17:17.000000000","message":"ditto","commit_id":"f9e45edca30d804dd371e8cc05883386c1508033"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"126e2f723b6f0a82ab04316414b08b94f9d40ed8","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            mock_device_list.return_value \u003d []"},{"line_number":68,"context_line":"            hostname \u003d None"},{"line_number":69,"context_line":"            dev_filter \u003d {\u0027hostname\u0027: hostname}"},{"line_number":70,"context_line":"            attach_handles \u003d objects.Device.get_list_by_hostname("},{"line_number":71,"context_line":"                self.context, hostname)"},{"line_number":72,"context_line":"            mock_device_list.assert_called_once_with("},{"line_number":73,"context_line":"                self.context, dev_filter)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_feec1e93","line":70,"range":{"start_line":70,"start_character":12,"end_line":70,"end_character":26},"in_reply_to":"3fa7e38b_5e17729e","updated":"2019-12-30 02:42:39.000000000","message":"Done","commit_id":"f9e45edca30d804dd371e8cc05883386c1508033"},{"author":{"_account_id":24872,"name":"YumengBao","email":"yumeng_bao@yahoo.com","username":"Yumeng_Bao"},"change_message_id":"a86e8aa8cdb9bdd91569146e5386dabd92b0f07e","unresolved":false,"context_lines":[{"line_number":71,"context_line":"                self.context, hostname)"},{"line_number":72,"context_line":"            mock_device_list.assert_called_once_with("},{"line_number":73,"context_line":"                self.context, dev_filter)"},{"line_number":74,"context_line":"            self.assertEqual([], attach_handles)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def test_list(self):"},{"line_number":77,"context_line":"        with mock.patch.object(self.dbapi, \u0027device_list\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_fe75fe00","line":74,"range":{"start_line":74,"start_character":33,"end_line":74,"end_character":47},"updated":"2019-12-30 02:17:17.000000000","message":"ditto","commit_id":"f9e45edca30d804dd371e8cc05883386c1508033"},{"author":{"_account_id":28748,"name":"chenker","email":"chen.ke14@zte.com.cn","username":"chenke"},"change_message_id":"126e2f723b6f0a82ab04316414b08b94f9d40ed8","unresolved":false,"context_lines":[{"line_number":71,"context_line":"                self.context, hostname)"},{"line_number":72,"context_line":"            mock_device_list.assert_called_once_with("},{"line_number":73,"context_line":"                self.context, dev_filter)"},{"line_number":74,"context_line":"            self.assertEqual([], attach_handles)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def test_list(self):"},{"line_number":77,"context_line":"        with mock.patch.object(self.dbapi, \u0027device_list\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_1ef25a70","line":74,"range":{"start_line":74,"start_character":33,"end_line":74,"end_character":47},"in_reply_to":"3fa7e38b_fe75fe00","updated":"2019-12-30 02:42:39.000000000","message":"Done","commit_id":"f9e45edca30d804dd371e8cc05883386c1508033"}]}
