Browse Source

add StatusUnprocessableEntity constant

Will Norris 10 years ago
parent
commit
1ef1ae6f86
2 changed files with 6 additions and 1 deletions
  1. +5
    -0
      github/github.go
  2. +1
    -1
      github/orgs_teams_test.go

+ 5
- 0
github/github.go View File

@ -23,6 +23,11 @@ import (
"github.com/google/go-querystring/query"
)
const (
// StatusUnprocessableEntity is the status code returned when sending a request with invalid fields.
StatusUnprocessableEntity = 422
)
const (
libraryVersion = "0.1"
defaultBaseURL = "https://api.github.com/"


+ 1
- 1
github/orgs_teams_test.go View File

@ -384,7 +384,7 @@ func TestOrganizationsService_AddTeamRepo_noAccess(t *testing.T) {
mux.HandleFunc("/teams/1/repos/o/r", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "PUT")
w.WriteHeader(422)
w.WriteHeader(StatusUnprocessableEntity)
})
_, err := client.Organizations.AddTeamRepo(1, "o", "r", nil)


Loading…
Cancel
Save