Skip to content

Commit

Permalink
Correct assertions in bad ISO test
Browse files Browse the repository at this point in the history
- Fix argument order (expected should come first).
- Remove error message assertion. IMO we only really care about the code
  and source.
  • Loading branch information
kenany committed Apr 26, 2024
1 parent 01311dd commit 76c1986
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pangea-sdk/v3/service/embargo/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,9 @@ func Test_Integration_Check_Error_BadISO(t *testing.T) {
assert.Nil(t, out)
fmt.Println(err.Error())
apiErr := err.(*pangea.APIError)
assert.Equal(t, len(apiErr.PangeaErrors.Errors), 1)
assert.Equal(t, apiErr.PangeaErrors.Errors[0].Code, "DoesNotMatchPattern")
assert.Equal(t, apiErr.PangeaErrors.Errors[0].Detail, "'iso_code' must match the given regex: ^[a-zA-Z]{2}$")
assert.Equal(t, apiErr.PangeaErrors.Errors[0].Source, "/iso_code")
assert.Equal(t, 1, len(apiErr.PangeaErrors.Errors))
assert.Equal(t, "DoesNotMatchPattern", apiErr.PangeaErrors.Errors[0].Code)
assert.Equal(t, "/iso_code", apiErr.PangeaErrors.Errors[0].Source)
}

func Test_Integration_Check_Error_BadToken(t *testing.T) {
Expand Down

0 comments on commit 76c1986

Please sign in to comment.