From 127a55c5dacd73bd0fd92d6b5623e04c72b3c9d2 Mon Sep 17 00:00:00 2001 From: zhihuz <139523949+zhihuizhang17@users.noreply.github.com> Date: Wed, 3 Jan 2024 23:24:18 +0800 Subject: [PATCH] fix test cases (#22) --- examples/helloworld/test/hello_world_test.exs | 2 +- examples/helloworld/test/reflection_test.exs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/helloworld/test/hello_world_test.exs b/examples/helloworld/test/hello_world_test.exs index ec3b40b..7b16cca 100644 --- a/examples/helloworld/test/hello_world_test.exs +++ b/examples/helloworld/test/hello_world_test.exs @@ -11,7 +11,7 @@ defmodule HelloworldTest do end test "helloworld should be successful", %{channel: channel} do - req = Helloworld.HelloRequest.new(name: "grpc-elixir") + req = %Helloworld.HelloRequest{name: "grpc-elixir"} assert {:ok, %{message: msg, today: _}} = Helloworld.Greeter.Stub.say_hello(channel, req) assert msg == "Hello grpc-elixir" end diff --git a/examples/helloworld/test/reflection_test.exs b/examples/helloworld/test/reflection_test.exs index 97b1bfd..5dd590c 100644 --- a/examples/helloworld/test/reflection_test.exs +++ b/examples/helloworld/test/reflection_test.exs @@ -15,7 +15,7 @@ defmodule Helloworld.ReflectionTest do message = {:list_services, ""} assert {:ok, %{service: service_list}} = run_request(message, ctx) names = Enum.map(service_list, &Map.get(&1, :name)) - assert names == ["helloworld.Greeter", "grpc.reflection.v1.ServerReflection"] + assert names == ["helloworld.Greeter"] end test "listing methods on our service", ctx do @@ -36,7 +36,7 @@ defmodule Helloworld.ReflectionTest do assert_response(response) end - defp assert_response(%{service: [service]} = proto) do + defp assert_response(%{service: [service]} = _proto) do assert service.name == "Greeter" assert %{method: [method]} = service assert method.name == "SayHello"