Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cleptric committed Sep 4, 2023
1 parent 9015523 commit 7f5bb63
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions transport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,18 +321,13 @@ func TestGetRequestFromEvent(t *testing.T) {
}{
{
testName: "Sample Event",
event: NewEvent(),
event: newTestEvent(eventType),
apiURL: "https://host/path/api/42/envelope/",
},
{
testName: "Transaction",
event: func() *Event {
event := NewEvent()
event.Type = transactionType

return event
}(),
apiURL: "https://host/path/api/42/envelope/",
event: newTestEvent(transactionType),
apiURL: "https://host/path/api/42/envelope/",
},
}

Expand Down Expand Up @@ -361,6 +356,16 @@ func TestGetRequestFromEvent(t *testing.T) {
if ua := req.UserAgent(); ua != userAgent {
t.Errorf("got User-Agent = %q, want %q", ua, userAgent)
}

contentType := "application/x-sentry-envelope"
if ct := req.Header.Get("Content-Type"); ct != contentType {
t.Errorf("got Content-Type = %q, want %q", ct, contentType)
}

xSentryAuth := "Sentry sentry_version=7, sentry_client=sentry.go/0.0.1, sentry_key=key"
if auth := req.Header.Get("X-Sentry-Auth"); !strings.HasPrefix(auth, xSentryAuth) {
t.Errorf("got X-Sentry-Auth = %q, want %q", auth, xSentryAuth)
}
})
}
}
Expand Down

0 comments on commit 7f5bb63

Please sign in to comment.