Skip to content

Commit

Permalink
Improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
aleDsz committed May 14, 2024
1 parent c9e8179 commit d81280a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/kino/proxy_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,21 @@ defmodule Kino.ProxyTest do

test "sends chunked response" do
chunk = :crypto.strong_rand_bytes(10 * 1024 * 1024)
other_chunk = :crypto.strong_rand_bytes(10 * 1024 * 1024)

Kino.Proxy.listen(fn conn ->
{:ok, conn} = conn |> send_chunked(200) |> chunk(chunk)
conn = send_chunked(conn, 200)
assert conn.state == :chunked

{:ok, _conn} = chunk(conn, chunk)
{:ok, _conn} = chunk(conn, other_chunk)

conn
end)

conn = conn(:get, "/123/proxy/")
assert %{resp_body: ^chunk, status: 200} = run_endpoint(conn)
assert %{resp_body: body, status: 200} = run_endpoint(conn)
assert body == chunk <> other_chunk
end

test "upgrades with supported http protocol" do
Expand Down

0 comments on commit d81280a

Please sign in to comment.