)]}'
{"nova/compute/api.py":[{"author":{"_account_id":4419,"name":"Matthew Sherborne","email":"msherborne+openstack@gmail.com","username":"msherborne+openstack"},"change_message_id":"fb4698852c5c4f066ebffebf31b63d39896c3a95","unresolved":false,"context_lines":[{"line_number":2477,"context_line":"    def _assert_host_exists(self, context, host_name):"},{"line_number":2478,"context_line":"        \"\"\"Raise HostNotFound if compute host doesn\u0027t exist.\"\"\""},{"line_number":2479,"context_line":"        host_name \u003d self.db.service_get_by_host_and_topic(context, host_name,"},{"line_number":2480,"context_line":"                CONF.compute_topic)[\u0027host\u0027]"},{"line_number":2481,"context_line":"        if not host_name:"},{"line_number":2482,"context_line":"            raise exception.HostNotFound(host\u003dhost_name)"},{"line_number":2483,"context_line":"        return host_name"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAN3%2F%2F5ow%3D","line":2480,"updated":"2013-03-07 03:39:58.000000000","message":"self.db.service_get_by_host_and_topic() may return None;\n\nMaybe go:\n\nhost \u003d self.db.service_get_by_host_and_topic(context, host_name, CONF.compute_topic)\nif host is None:\n    raise exception.HostNotFound(host\u003dhost_name)\nhost_name \u003d host[\u0027host\u0027]","commit_id":"fda7716d6847f490556ca118d3fd024012b149d5"}],"nova/tests/compute/test_host_api.py":[{"author":{"_account_id":4419,"name":"Matthew Sherborne","email":"msherborne+openstack@gmail.com","username":"msherborne+openstack"},"change_message_id":"fb4698852c5c4f066ebffebf31b63d39896c3a95","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        def fake_assert_host_exists(context, host_name):"},{"line_number":42,"context_line":"            return \u0027fake_host\u0027"},{"line_number":43,"context_line":"        self.stubs.Set(self.host_api, \u0027_assert_host_exists\u0027,"},{"line_number":44,"context_line":"                                    fake_assert_host_exists)"},{"line_number":45,"context_line":"        self.host_api._assert_host_exists(self.ctxt, \u0027fake_host\u0027)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def test_set_host_enabled(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAN3%2F%2F5ok%3D","line":44,"updated":"2013-03-07 03:39:58.000000000","message":"We should leave mox, as it does test that the params are right in other methods.\n\nI would have _mock_assert_host_exists take a parameter:\n\n_mock_assert_host_exists(self, host_name\u003d\u0027fake_host\u0027)\n\nthen:\n\nself.mox.StubOutWithMock(self.host_api, \u0027_assert_host_exists\u0027)\nself.host_api._assert_host_exists(self.ctxt, host_name).AndReturn(\u0027fake_host\u0027)","commit_id":"fda7716d6847f490556ca118d3fd024012b149d5"},{"author":{"_account_id":1849,"name":"Joe Gordon","email":"joe.gordon0@gmail.com","username":"jogo"},"change_message_id":"852dc296b6012b71f8f83baa2a610515a9381c5f","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        def fake_assert_host_exists(context, host_name):"},{"line_number":42,"context_line":"            return \u0027fake_host\u0027"},{"line_number":43,"context_line":"        self.stubs.Set(self.host_api, \u0027_assert_host_exists\u0027,"},{"line_number":44,"context_line":"                                    fake_assert_host_exists)"},{"line_number":45,"context_line":"        self.host_api._assert_host_exists(self.ctxt, \u0027fake_host\u0027)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def test_set_host_enabled(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAN3%2F%2F4GU%3D","line":44,"in_reply_to":"AAAAN3%2F%2F5ok%3D","updated":"2013-03-07 22:29:30.000000000","message":"When I follow your suggestion for mox I get http://paste.openstack.org/show/32989/","commit_id":"fda7716d6847f490556ca118d3fd024012b149d5"},{"author":{"_account_id":4419,"name":"Matthew Sherborne","email":"msherborne+openstack@gmail.com","username":"msherborne+openstack"},"change_message_id":"fb4698852c5c4f066ebffebf31b63d39896c3a95","unresolved":false,"context_lines":[{"line_number":42,"context_line":"            return \u0027fake_host\u0027"},{"line_number":43,"context_line":"        self.stubs.Set(self.host_api, \u0027_assert_host_exists\u0027,"},{"line_number":44,"context_line":"                                    fake_assert_host_exists)"},{"line_number":45,"context_line":"        self.host_api._assert_host_exists(self.ctxt, \u0027fake_host\u0027)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def test_set_host_enabled(self):"},{"line_number":48,"context_line":"        self._mock_assert_host_exists()"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAN3%2F%2F5og%3D","line":45,"updated":"2013-03-07 03:39:58.000000000","message":"This line was only needed by mox and could be deleted if you\u0027re not using it anymore.\n\nBut I would leave mox in if possible.","commit_id":"fda7716d6847f490556ca118d3fd024012b149d5"},{"author":{"_account_id":4419,"name":"Matthew Sherborne","email":"msherborne+openstack@gmail.com","username":"msherborne+openstack"},"change_message_id":"fb4698852c5c4f066ebffebf31b63d39896c3a95","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        self.assertEqual(\u0027fake-result\u0027, result)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def test_host_name_from_assert_hosts_exists(self):"},{"line_number":60,"context_line":"        self._mock_assert_host_exists()"},{"line_number":61,"context_line":"        self._mock_rpc_call("},{"line_number":62,"context_line":"                {\u0027method\u0027: \u0027set_host_enabled\u0027,"},{"line_number":63,"context_line":"                 \u0027args\u0027: {\u0027enabled\u0027: \u0027fake_enabled\u0027},"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAN3%2F%2F5n8%3D","line":60,"updated":"2013-03-07 03:39:58.000000000","message":"So here you could go:\n\nself._mock_assert_host_exists(\u0027fake_hosT\u0027)\n\nto make the mocked out method expect the capital T","commit_id":"fda7716d6847f490556ca118d3fd024012b149d5"}]}
