def test_call_method_error(self):
        server = JsonRpcServer(echo_app)
        server.listen(('127.0.0.1', 0))
        addr = server.addresses[0]
        client = JsonRpcClient()
        client.connect(addr)
        exc = self.assertRaises(JsonRpcError, client.call_method, 'echo2')
        self.assertIsInstance(exc, JsonRpcError)
        self.assertIsInstance(exc.error, dict)
        self.assertEqual(exc.error['code'], jsonrpc.METHOD_NOT_FOUND)
        server.close()
        client.close()