@@ -12,7 +12,7 @@ defmodule Twirp.ClientTest do
1212 setup do
1313 service = Bypass . open ( )
1414 base_url = "http://localhost:#{ service . port } "
15- client = Client . client ( base_url , [ ] )
15+ client = Client . client ( base_url , [ ] , [ ] )
1616
1717 { :ok , service: service , client: client }
1818 end
@@ -53,15 +53,15 @@ defmodule Twirp.ClientTest do
5353 |> Plug.Conn . resp ( 200 , ~s| {"msg": "Test"}| )
5454 end )
5555
56- client = Client . client ( :json , "http://localhost:#{ service . port } " , [ ] )
56+ client = Client . client ( :json , "http://localhost:#{ service . port } " , [ ] , [ ] )
5757
5858 assert { :ok , resp } = Client . echo ( client , Req . new ( msg: "Test" ) )
5959 assert match? ( % Resp { } , resp )
6060 assert resp . msg == "Test"
6161 end
6262
6363 test "if rpc is not defined return an error" do
64- client = Client . client ( "" , [ ] )
64+ client = Client . client ( "" , [ ] , [ ] )
6565 { :error , resp } = Client . rpc ( client , :Undefined , Req . new ( msg: "test" ) )
6666 assert match? ( % Twirp.Error { code: :bad_route } , resp )
6767 end
@@ -150,4 +150,12 @@ defmodule Twirp.ClientTest do
150150 assert { :error , resp } = Client . echo ( client , Req . new ( msg: "test" ) )
151151 assert resp . code == :unavailable
152152 end
153+
154+ describe "pools" do
155+ test "start/1 starts a dedicated hackney pool" do
156+ assert :ok == Client . start ( )
157+ assert pid = :hackney_pool . find_pool ( Client.Pool )
158+ assert is_pid ( pid )
159+ end
160+ end
153161end
0 commit comments