Skip to content

Commit

Permalink
fix test cases (elixir-grpc#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhihuizhang17 authored Jan 3, 2024
1 parent a86e804 commit 127a55c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/helloworld/test/hello_world_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/helloworld/test/reflection_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit 127a55c

Please sign in to comment.