)]}'
{"openstack_dashboard/dashboards/project/api_access/tests.py":[{"author":{"_account_id":8478,"name":"Vladislav Kuzmin","email":"vkuzmin@mirantis.com","username":"vkuzmin"},"change_message_id":"5cfc300d918ae00f15afd76e0cafaa766b95b3c0","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        mock_list_ec2_credentials.assert_called_once_with("},{"line_number":98,"context_line":"            test.IsHttpRequest(), self.user.id)"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    @mock.patch.object(api.keystone, \u0027create_ec2_credentials\u0027)"},{"line_number":101,"context_line":"    @mock.patch.object(api.keystone, \u0027list_ec2_credentials\u0027)"},{"line_number":102,"context_line":"    @mock.patch.object(api.keystone, \u0027delete_user_ec2_credentials\u0027)"},{"line_number":103,"context_line":"    def _test_recreate_user_credentials(self,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa0c359_7302b40d","line":100,"range":{"start_line":100,"start_character":0,"end_line":100,"end_character":4},"updated":"2018-02-20 08:27:12.000000000","message":"Let\u0027s use create_mocks() in this test file. This will improve the readability of the tests.","commit_id":"3a0dbdad7fa58731a2cd475a6d6cf4fa6a2e4617"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"2ccc935bb8576e12ef3f3ebb6ad155bbedb1acd6","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        mock_list_ec2_credentials.assert_called_once_with("},{"line_number":98,"context_line":"            test.IsHttpRequest(), self.user.id)"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    @mock.patch.object(api.keystone, \u0027create_ec2_credentials\u0027)"},{"line_number":101,"context_line":"    @mock.patch.object(api.keystone, \u0027list_ec2_credentials\u0027)"},{"line_number":102,"context_line":"    @mock.patch.object(api.keystone, \u0027delete_user_ec2_credentials\u0027)"},{"line_number":103,"context_line":"    def _test_recreate_user_credentials(self,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa0c359_e4435c12","line":100,"range":{"start_line":100,"start_character":0,"end_line":100,"end_character":4},"in_reply_to":"3fa0c359_7302b40d","updated":"2018-02-20 09:40:15.000000000","message":"Yes, create_mocks() looks better. this was converted before it was introduced.","commit_id":"3a0dbdad7fa58731a2cd475a6d6cf4fa6a2e4617"},{"author":{"_account_id":8478,"name":"Vladislav Kuzmin","email":"vkuzmin@mirantis.com","username":"vkuzmin"},"change_message_id":"a2984f6bec9a3d0a44ab28be265e5cb8b3fc9177","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"class APIAccessTests(test.TestCase):"},{"line_number":37,"context_line":"    @test.create_mocks({api.keystone: (\u0027create_ec2_credentials\u0027,"},{"line_number":38,"context_line":"                                       \u0027list_ec2_credentials\u0027)})"},{"line_number":39,"context_line":"    def test_ec2_download_view(self):"},{"line_number":40,"context_line":"        creds \u003d self.ec2.first()"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa0c359_46b9e612","line":37,"range":{"start_line":37,"start_character":38,"end_line":37,"end_character":40},"updated":"2018-02-20 20:30:03.000000000","message":"Can we use list here instead tuple? I think we should use tuple to group similar methods. From documentation: \"The tuple version is useful when there are multiple methods with a same name are mocked in a single test.\"","commit_id":"669a91e0dec77adb56010f16479ea7f1f6e12a96"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"93e1ea8ec1477d9c3f0a704d7c57b6b055aba4fa","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"class APIAccessTests(test.TestCase):"},{"line_number":37,"context_line":"    @test.create_mocks({api.keystone: (\u0027create_ec2_credentials\u0027,"},{"line_number":38,"context_line":"                                       \u0027list_ec2_credentials\u0027)})"},{"line_number":39,"context_line":"    def test_ec2_download_view(self):"},{"line_number":40,"context_line":"        creds \u003d self.ec2.first()"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa0c359_bfb44f37","line":37,"range":{"start_line":37,"start_character":38,"end_line":37,"end_character":40},"in_reply_to":"3fa0c359_46b9e612","updated":"2018-02-21 22:52:15.000000000","message":"\u003e Can we use list here instead tuple? I think we should use tuple to\n \u003e group similar methods. \n\nBoth list and tuple can be used, and there is no actual difference.\n\nIn addition, existing create_stubs() for mox uses a tuple. Replacing all of them to a list just wastes time and I see no value in doing so. For consistency, I chose a tuple here.\n\n \u003e From documentation: \"The tuple version is\n \u003e useful when there are multiple methods with a same name are mocked\n \u003e in a single test.\"\n\nThis is about an element of a tuple/list, so it is not related to a tuple here.","commit_id":"669a91e0dec77adb56010f16479ea7f1f6e12a96"},{"author":{"_account_id":8478,"name":"Vladislav Kuzmin","email":"vkuzmin@mirantis.com","username":"vkuzmin"},"change_message_id":"516fd8bf62876e1f58e98fc693716c3fbebf992d","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            self.mock_delete_user_ec2_credentials.assert_called_once_with("},{"line_number":122,"context_line":"                test.IsHttpRequest(), self.user.id, old_creds[0].access)"},{"line_number":123,"context_line":"        else:"},{"line_number":124,"context_line":"            self.assertEqual(0,"},{"line_number":125,"context_line":"                             self.mock_delete_user_ec2_credentials.call_count)"},{"line_number":126,"context_line":"        self.mock_create_ec2_credentials.assert_called_once_with("},{"line_number":127,"context_line":"            test.IsHttpRequest(), self.user.id, self.tenant.id)"},{"line_number":128,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"ff6b8bd7_0f529568","line":125,"range":{"start_line":124,"start_character":12,"end_line":125,"end_character":78},"updated":"2018-03-05 17:58:15.000000000","message":"You can use assert_not_called() in this case.","commit_id":"8f765c16e8e571bba1625a4ff91ae36c6010aee1"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"bf86d2bb56aabb52187f07a4048d1bd2132ee7c4","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            self.mock_delete_user_ec2_credentials.assert_called_once_with("},{"line_number":122,"context_line":"                test.IsHttpRequest(), self.user.id, old_creds[0].access)"},{"line_number":123,"context_line":"        else:"},{"line_number":124,"context_line":"            self.assertEqual(0,"},{"line_number":125,"context_line":"                             self.mock_delete_user_ec2_credentials.call_count)"},{"line_number":126,"context_line":"        self.mock_create_ec2_credentials.assert_called_once_with("},{"line_number":127,"context_line":"            test.IsHttpRequest(), self.user.id, self.tenant.id)"},{"line_number":128,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"df7087c5_ea62a5d8","line":125,"range":{"start_line":124,"start_character":12,"end_line":125,"end_character":78},"in_reply_to":"df7087c5_4a3871d2","updated":"2018-03-07 14:25:26.000000000","message":"Done","commit_id":"8f765c16e8e571bba1625a4ff91ae36c6010aee1"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"bbfeb75e1f9d742caf6ce7273f39e87fb9d588e0","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            self.mock_delete_user_ec2_credentials.assert_called_once_with("},{"line_number":122,"context_line":"                test.IsHttpRequest(), self.user.id, old_creds[0].access)"},{"line_number":123,"context_line":"        else:"},{"line_number":124,"context_line":"            self.assertEqual(0,"},{"line_number":125,"context_line":"                             self.mock_delete_user_ec2_credentials.call_count)"},{"line_number":126,"context_line":"        self.mock_create_ec2_credentials.assert_called_once_with("},{"line_number":127,"context_line":"            test.IsHttpRequest(), self.user.id, self.tenant.id)"},{"line_number":128,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"df7087c5_4a3871d2","line":125,"range":{"start_line":124,"start_character":12,"end_line":125,"end_character":78},"in_reply_to":"df7087c5_d3a76c4f","updated":"2018-03-07 14:21:11.000000000","message":"I didn\u0027t checked from which version mock supports assert_not_called(), but our minimum version of mock is 2.0.0 and this is the version we use now, so we can use assert_not_called() safely. Thanks. I didn\u0027t notice assert_not_called() was added.","commit_id":"8f765c16e8e571bba1625a4ff91ae36c6010aee1"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"8e7b3d793179827ef278a653077609fae6146d90","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            self.mock_delete_user_ec2_credentials.assert_called_once_with("},{"line_number":122,"context_line":"                test.IsHttpRequest(), self.user.id, old_creds[0].access)"},{"line_number":123,"context_line":"        else:"},{"line_number":124,"context_line":"            self.assertEqual(0,"},{"line_number":125,"context_line":"                             self.mock_delete_user_ec2_credentials.call_count)"},{"line_number":126,"context_line":"        self.mock_create_ec2_credentials.assert_called_once_with("},{"line_number":127,"context_line":"            test.IsHttpRequest(), self.user.id, self.tenant.id)"},{"line_number":128,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"df7087c5_d3a76c4f","line":125,"range":{"start_line":124,"start_character":12,"end_line":125,"end_character":78},"in_reply_to":"ff6b8bd7_0f529568","updated":"2018-03-07 14:15:28.000000000","message":"From which version is assert_not_called() supported?\nIn python 3 it was introduced in python 3.5 [1]. This is okay.\nHow about mock for python 2.7?\n\n[1] https://docs.python.org/3.5/library/unittest.mock.html#unittest.mock.Mock.assert_not_called","commit_id":"8f765c16e8e571bba1625a4ff91ae36c6010aee1"}],"openstack_dashboard/dashboards/project/overview/tests.py":[{"author":{"_account_id":8478,"name":"Vladislav Kuzmin","email":"vkuzmin@mirantis.com","username":"vkuzmin"},"change_message_id":"5cfc300d918ae00f15afd76e0cafaa766b95b3c0","unresolved":false,"context_lines":[{"line_number":33,"context_line":"INDEX_URL \u003d reverse(\u0027horizon:project:overview:index\u0027)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"def create_mocks(obj, methods):"},{"line_number":37,"context_line":"    def wrapper(function):"},{"line_number":38,"context_line":"        def wrapped(inst, *args, **kwargs):"},{"line_number":39,"context_line":"            for method in methods:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa0c359_fe5f6be2","line":36,"range":{"start_line":36,"start_character":4,"end_line":36,"end_character":16},"updated":"2018-02-20 08:27:12.000000000","message":"I think we should use create_mocks() (or pick it out to a common helpers module) from openstack_dashboard/test/helpers.py, because these methods almost the same. And these two methods have the same name, but different API - this introduces uncertainty.","commit_id":"3a0dbdad7fa58731a2cd475a6d6cf4fa6a2e4617"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"2ccc935bb8576e12ef3f3ebb6ad155bbedb1acd6","unresolved":false,"context_lines":[{"line_number":33,"context_line":"INDEX_URL \u003d reverse(\u0027horizon:project:overview:index\u0027)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"def create_mocks(obj, methods):"},{"line_number":37,"context_line":"    def wrapper(function):"},{"line_number":38,"context_line":"        def wrapped(inst, *args, **kwargs):"},{"line_number":39,"context_line":"            for method in methods:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa0c359_e4f59cee","line":36,"range":{"start_line":36,"start_character":4,"end_line":36,"end_character":16},"in_reply_to":"3fa0c359_fe5f6be2","updated":"2018-02-20 09:40:15.000000000","message":"Yeah, this is the old one before create_mocks was officially merged. This needs to be clean up.","commit_id":"3a0dbdad7fa58731a2cd475a6d6cf4fa6a2e4617"},{"author":{"_account_id":8478,"name":"Vladislav Kuzmin","email":"vkuzmin@mirantis.com","username":"vkuzmin"},"change_message_id":"516fd8bf62876e1f58e98fc693716c3fbebf992d","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            self._check_stu_enabled(stu_exception,"},{"line_number":70,"context_line":"                                    overview_days_range\u003doverview_days_range)"},{"line_number":71,"context_line":"        else:"},{"line_number":72,"context_line":"            self.assertEqual(0, self.mock_usage_get.call_count)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    @test.create_mocks({api.cinder: ("},{"line_number":75,"context_line":"        (\u0027tenant_absolute_limits\u0027, \u0027cinder_tenant_absolute_limits\u0027),"}],"source_content_type":"text/x-python","patch_set":7,"id":"ff6b8bd7_f5692f8b","line":72,"range":{"start_line":72,"start_character":12,"end_line":72,"end_character":63},"updated":"2018-03-05 17:58:15.000000000","message":"You can use assert_not_called() here.","commit_id":"8f765c16e8e571bba1625a4ff91ae36c6010aee1"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"bf86d2bb56aabb52187f07a4048d1bd2132ee7c4","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            self._check_stu_enabled(stu_exception,"},{"line_number":70,"context_line":"                                    overview_days_range\u003doverview_days_range)"},{"line_number":71,"context_line":"        else:"},{"line_number":72,"context_line":"            self.assertEqual(0, self.mock_usage_get.call_count)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    @test.create_mocks({api.cinder: ("},{"line_number":75,"context_line":"        (\u0027tenant_absolute_limits\u0027, \u0027cinder_tenant_absolute_limits\u0027),"}],"source_content_type":"text/x-python","patch_set":7,"id":"df7087c5_0a6039ce","line":72,"range":{"start_line":72,"start_character":12,"end_line":72,"end_character":63},"in_reply_to":"ff6b8bd7_f5692f8b","updated":"2018-03-07 14:25:26.000000000","message":"Done","commit_id":"8f765c16e8e571bba1625a4ff91ae36c6010aee1"}],"openstack_dashboard/dashboards/project/snapshots/tests.py":[{"author":{"_account_id":8478,"name":"Vladislav Kuzmin","email":"vkuzmin@mirantis.com","username":"vkuzmin"},"change_message_id":"516fd8bf62876e1f58e98fc693716c3fbebf992d","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"class VolumeSnapshotsViewTests(test.TestCase):"},{"line_number":36,"context_line":"    @test.create_mocks({api.cinder: (\u0027tenant_absolute_limits\u0027,"},{"line_number":37,"context_line":"                                     \u0027volume_snapshot_list_paged\u0027,"},{"line_number":38,"context_line":"                                     \u0027volume_list\u0027),"},{"line_number":39,"context_line":"                        api.base: (\u0027is_service_enabled\u0027,)})"}],"source_content_type":"text/x-python","patch_set":7,"id":"ff6b8bd7_ef5e4144","line":36,"range":{"start_line":36,"start_character":37,"end_line":36,"end_character":61},"updated":"2018-03-05 17:58:15.000000000","message":"Do we need to mock \u0027tenant_absolute_limits\u0027, because this method doesn\u0027t use in the test?","commit_id":"8f765c16e8e571bba1625a4ff91ae36c6010aee1"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"bf86d2bb56aabb52187f07a4048d1bd2132ee7c4","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"class VolumeSnapshotsViewTests(test.TestCase):"},{"line_number":36,"context_line":"    @test.create_mocks({api.cinder: (\u0027tenant_absolute_limits\u0027,"},{"line_number":37,"context_line":"                                     \u0027volume_snapshot_list_paged\u0027,"},{"line_number":38,"context_line":"                                     \u0027volume_list\u0027),"},{"line_number":39,"context_line":"                        api.base: (\u0027is_service_enabled\u0027,)})"}],"source_content_type":"text/x-python","patch_set":7,"id":"df7087c5_aa9a6dc2","line":36,"range":{"start_line":36,"start_character":37,"end_line":36,"end_character":61},"in_reply_to":"ff6b8bd7_ef5e4144","updated":"2018-03-07 14:25:26.000000000","message":"This method turns out unnecessary. Removed it.","commit_id":"8f765c16e8e571bba1625a4ff91ae36c6010aee1"}]}
