Skip to content

Commit

Permalink
chore: code style
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Feb 23, 2022
1 parent b8868f4 commit aa9c8d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion request/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ func authStrategy(name string, config json.RawMessage) (AuthStrategy, error) {
}

return nil, fmt.Errorf("unsupported auth type: %s", name)

}
12 changes: 6 additions & 6 deletions request/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestBuildRequest(t *testing.T) {
method string
url string
authStrategy string
header http.Header
expectedHeader http.Header
bodyTemplateURI string
body *testRequestBody
expectedBody string
Expand Down Expand Up @@ -93,7 +93,7 @@ func TestBuildRequest(t *testing.T) {
method: "POST",
url: "https://test.kratos.ory.sh/my_endpoint2",
authStrategy: "",
header: map[string][]string{"Custom-Header": {"test"}},
expectedHeader: map[string][]string{"Custom-Header": {"test"}},
bodyTemplateURI: "file://./stub/test_body.jsonnet",
body: &testRequestBody{
To: "+12127110378",
Expand Down Expand Up @@ -184,7 +184,7 @@ func TestBuildRequest(t *testing.T) {
url: "https://test.kratos.ory.sh/my_endpoint6",
bodyTemplateURI: "file://./stub/test_body.jsonnet",
authStrategy: "api_key",
header: map[string][]string{"Content-Type": {ContentTypeForm}},
expectedHeader: map[string][]string{"Content-Type": {ContentTypeForm}},
body: &testRequestBody{
To: "+14134242223",
From: "+13104661805",
Expand Down Expand Up @@ -214,7 +214,7 @@ func TestBuildRequest(t *testing.T) {
url: "https://test.kratos.ory.sh/my_endpoint7",
bodyTemplateURI: "file://./stub/test_body.jsonnet",
authStrategy: "basic_auth",
header: map[string][]string{"Content-Type": {ContentTypeJSON}},
expectedHeader: map[string][]string{"Content-Type": {ContentTypeJSON}},
body: &testRequestBody{
To: "+14134242223",
From: "+13104661805",
Expand Down Expand Up @@ -257,8 +257,8 @@ func TestBuildRequest(t *testing.T) {
assert.Equal(t, tc.expectedBody, string(requestBody))
}

if tc.header != nil {
mustContainHeader(t, tc.header, req.Header)
if tc.expectedHeader != nil {
mustContainHeader(t, tc.expectedHeader, req.Header)
}
})
}
Expand Down

0 comments on commit aa9c8d7

Please sign in to comment.