(t *testing.T, e env)
| 2207 | } |
| 2208 | |
| 2209 | func testEmptyUnaryWithUserAgent(t *testing.T, e env) { |
| 2210 | te := newTest(t, e) |
| 2211 | te.userAgent = testAppUA |
| 2212 | te.startServer(&testServer{security: e.security}) |
| 2213 | defer te.tearDown() |
| 2214 | |
| 2215 | cc := te.clientConn() |
| 2216 | tc := testgrpc.NewTestServiceClient(cc) |
| 2217 | var header metadata.MD |
| 2218 | ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) |
| 2219 | defer cancel() |
| 2220 | reply, err := tc.EmptyCall(ctx, &testpb.Empty{}, grpc.Header(&header)) |
| 2221 | if err != nil || !proto.Equal(&testpb.Empty{}, reply) { |
| 2222 | t.Fatalf("TestService/EmptyCall(_, _) = %v, %v, want %v, <nil>", reply, err, &testpb.Empty{}) |
| 2223 | } |
| 2224 | if v, ok := header["ua"]; !ok || !strings.HasPrefix(v[0], testAppUA) { |
| 2225 | t.Fatalf("header[\"ua\"] = %q, %t, want string with prefix %q, true", v, ok, testAppUA) |
| 2226 | } |
| 2227 | |
| 2228 | te.srv.Stop() |
| 2229 | } |
| 2230 | |
| 2231 | func (s) TestFailedEmptyUnary(t *testing.T) { |
| 2232 | for _, e := range listTestEnv() { |
no test coverage detected