From 1ef1ae6f862a1e829a33c09b5a76673e249e5c88 Mon Sep 17 00:00:00 2001 From: Will Norris Date: Mon, 8 Feb 2016 11:03:18 -0800 Subject: [PATCH] add StatusUnprocessableEntity constant --- github/github.go | 5 +++++ github/orgs_teams_test.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/github/github.go b/github/github.go index 22e5b51..8a64455 100644 --- a/github/github.go +++ b/github/github.go @@ -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/" diff --git a/github/orgs_teams_test.go b/github/orgs_teams_test.go index a921592..a1d80f0 100644 --- a/github/orgs_teams_test.go +++ b/github/orgs_teams_test.go @@ -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)