)]}'
{"bgpvpn_dashboard/test/api_tests/bgpvpn_tests.py":[{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"3525d50f8dccfe9a5dc5d61628c91faca87f3550","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from bgpvpn_dashboard import api"},{"line_number":21,"context_line":"from bgpvpn_dashboard.test import helpers as bgpvpn_test"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"from neutronclient.v2_0.client import Client as neutronclient"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"BGPVPN_OBJECT_PATH \u003d \u0027/bgpvpn/bgpvpns\u0027"},{"line_number":26,"context_line":"BGPVPN_RESOURCE_PATH \u003d \u0027/bgpvpn/bgpvpns/%s\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f044301_3579defb","line":23,"range":{"start_line":23,"start_character":0,"end_line":23,"end_character":61},"updated":"2017-05-04 19:12:05.000000000","message":"It is not easy to read the code when a Class name changes to a lowercase name. Moreover, most often we try to only import\nmodules (not what is inside).\n\nI think this would be better:\n\nfrom neutronclient.v2_0 import client as n_client\n\nAnd in the rest of the file use \"n_client.Client\" instead of neutronclient.","commit_id":"92057f1379634294068e9ef44db50cc16d66cd31"},{"author":{"_account_id":12021,"name":"Thomas Morin","email":"tmmorin.orange@gmail.com","username":"tmorin"},"change_message_id":"3525d50f8dccfe9a5dc5d61628c91faca87f3550","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    def test_bgpvpn_list(self):"},{"line_number":35,"context_line":"        bgpvpns \u003d {\u0027bgpvpns\u0027: self.api_bgpvpns.list()}"},{"line_number":36,"context_line":"        uri \u003d BGPVPN_OBJECT_PATH"},{"line_number":37,"context_line":"        neutronclient.list_ext \u003d mock.Mock(return_value\u003dbgpvpns)"},{"line_number":38,"context_line":"        ret_val \u003d api.bgpvpn.bgpvpns_list(self.request)"},{"line_number":39,"context_line":"        neutronclient.list_ext.assert_called_once_with(\u0027bgpvpns\u0027, uri, True)"},{"line_number":40,"context_line":"        for n in ret_val:"},{"line_number":41,"context_line":"            self.assertIsInstance(n, api.bgpvpn.Bgpvpn)"},{"line_number":42,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3f044301_15302256","line":39,"range":{"start_line":37,"start_character":22,"end_line":39,"end_character":76},"updated":"2017-05-04 19:12:05.000000000","message":"As discussed today, this can indeed become:\n\n...\nneutronclient.list_bgpvpns \u003d mock.Mock(...)\nret_val \u003d api.bgpvpn.bgpvpns_list(self.request)\nneutronclient.list_bgpvpns.assert_called_once()\n...\n\nAlternative:\n\n@mock.patch.object(neutronclient, \u0027list_bgpvpns\u0027, return_value\u003dself.api_bgpvpns.list())\ndef test_bgpvpn_list(self, list_bgpvpns):\n    ret_val \u003d api.bgpvpn.bgpvpns_list(self.request)\n    list_bgpvpns.assert_called_once()\n    for n in ret_val:\n        self.assertIsInstance(n, api.bgpvpn.Bgpvpn)\n\nThen you shouldn\u0027t have to redefine the *_PATH constants.\n\n(similarly for the rest of the file)","commit_id":"92057f1379634294068e9ef44db50cc16d66cd31"}]}
