aboutsummaryrefslogtreecommitdiffstats
path: root/integrations
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-05-31 22:59:34 +0200
committerGitHub <noreply@github.com>2020-05-31 21:59:34 +0100
commitb636cd6fd40ae05f22e732574da10af060273f9f (patch)
tree83de939bca57ad39c588117678079d9dc3e64751 /integrations
parent34b6983f566d3ced9d0ff9a4e1c2138b6d7fbcfe (diff)
downloadgitea-b636cd6fd40ae05f22e732574da10af060273f9f.tar.gz
gitea-b636cd6fd40ae05f22e732574da10af060273f9f.zip
Handle expected errors in FileCreate & FileUpdate API (#11643)
as title needed for #11641
Diffstat (limited to 'integrations')
-rw-r--r--integrations/api_repo_file_create_test.go2
-rw-r--r--integrations/api_repo_file_update_test.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/integrations/api_repo_file_create_test.go b/integrations/api_repo_file_create_test.go
index 3c8b50d5d1..853224f091 100644
--- a/integrations/api_repo_file_create_test.go
+++ b/integrations/api_repo_file_create_test.go
@@ -189,7 +189,7 @@ func TestAPICreateFile(t *testing.T) {
treePath = "README.md"
url = fmt.Sprintf("/api/v1/repos/%s/%s/contents/%s?token=%s", user2.Name, repo1.Name, treePath, token2)
req = NewRequestWithJSON(t, "POST", url, &createFileOptions)
- resp = session.MakeRequest(t, req, http.StatusInternalServerError)
+ resp = session.MakeRequest(t, req, http.StatusUnprocessableEntity)
expectedAPIError := context.APIError{
Message: "repository file already exists [path: " + treePath + "]",
URL: setting.API.SwaggerURL,
diff --git a/integrations/api_repo_file_update_test.go b/integrations/api_repo_file_update_test.go
index 369e48d646..69a9463774 100644
--- a/integrations/api_repo_file_update_test.go
+++ b/integrations/api_repo_file_update_test.go
@@ -208,7 +208,7 @@ func TestAPIUpdateFile(t *testing.T) {
updateFileOptions.SHA = "badsha"
url = fmt.Sprintf("/api/v1/repos/%s/%s/contents/%s?token=%s", user2.Name, repo1.Name, treePath, token2)
req = NewRequestWithJSON(t, "PUT", url, &updateFileOptions)
- resp = session.MakeRequest(t, req, http.StatusInternalServerError)
+ resp = session.MakeRequest(t, req, http.StatusUnprocessableEntity)
expectedAPIError := context.APIError{
Message: "sha does not match [given: " + updateFileOptions.SHA + ", expected: " + correctSHA + "]",
URL: setting.API.SwaggerURL,