Skip to content

Commit

Permalink
Add failing test for gRPC REST proxy response
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaseizinger committed Apr 1, 2020
1 parent f329ae0 commit a608b28
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,41 @@ test! {

}

test! {
name: gprc_response_transfer_encoding_chunked,

server:
expected: "\
GET /v1/invoice/16c3d4559f33a65c44fd3419d4f48fb02c9386410118f5cf89669e2f726e1b63 HTTP/1.1\r\n\
host: {addr}\r\n\
\r\n\
",
reply: "\
HTTP/1.1 500 Internal Server Error\r\n\
Content-Type: application/json\r\n\
Trailer: Grpc-Trailer-Content-Type\r\n\
Date: Wed, 01 Apr 2020 00:16:52 GMT\r\n\
Transfer-Encoding: chunked\r\n\
\r\n\
5e\r\n\
{\"error\":\"there are no existing invoices\",\"message\":\"there are no existing invoices\",\"code\":2}\r\n\
0\r\n\
Grpc-Trailer-Content-Type: application/grpc\r\n\
\r\n\
{\"error\":\"there are no existing invoices\",\"message\":\"there are no existing invoices\",\"code\":2}%\r\n\
",

client:
request: {
method: GET,
url: "http://{addr}/v1/invoice/16c3d4559f33a65c44fd3419d4f48fb02c9386410118f5cf89669e2f726e1b63",
},
response:
status: INTERNAL_SERVER_ERROR,
headers: {},
body: None,
}

test! {
name: client_set_host_false,

Expand Down

0 comments on commit a608b28

Please sign in to comment.