Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
josephbarnett committed Jul 9, 2024
1 parent 3c7f06f commit c1a0ffd
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions pkg/telemetry/post_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@ func TestPostStatus(t *testing.T) {
{
name: "good",
},
// {
// name: "bad request error",
// badRequest: true,
// wantErr: true,
// },
// {
// name: "timeout error",
// doTimeout: true,
// wantErr: true,
// },
{
name: "bad request error",
badRequest: true,
wantErr: true,
},
{
name: "timeout error",
doTimeout: true,
wantErr: true,
},
}

// Create a mock HTTP server
Expand Down Expand Up @@ -151,12 +151,7 @@ func NewTestServerHandler(t *testing.T) *testHandler {
func (ts *testHandler) Handler(w net.ResponseWriter, r *net.Request) {
ts.t.Helper()
// Verify the request headers
contentEncoding := r.Header.Get(http.HeaderContentEncoding)
contentType := r.Header.Get(http.HeaderContentType)
if contentEncoding != http.ContentTypeGzip {
net.Error(w, "unexpected content encoding", net.StatusBadRequest)
return
}
if contentType != http.ContentTypeProtobuf {
net.Error(w, "unexpected content type", net.StatusBadRequest)
return
Expand Down

0 comments on commit c1a0ffd

Please sign in to comment.