mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-06-22 21:04:41 +08:00
Add Swift login endpoint (#32693)
Fix #32683 This PR adds the login endpoint and fixes the documentation links.
This commit is contained in:
@ -42,6 +42,24 @@ func TestPackageSwift(t *testing.T) {
|
||||
|
||||
url := fmt.Sprintf("/api/packages/%s/swift", user.Name)
|
||||
|
||||
t.Run("CheckLogin", func(t *testing.T) {
|
||||
defer tests.PrintCurrentTest(t)()
|
||||
|
||||
req := NewRequestWithBody(t, "POST", url, strings.NewReader(""))
|
||||
MakeRequest(t, req, http.StatusUnauthorized)
|
||||
|
||||
req = NewRequestWithBody(t, "POST", url, strings.NewReader("")).
|
||||
AddBasicAuth(user.Name)
|
||||
MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
req = NewRequestWithBody(t, "POST", url+"/login", strings.NewReader(""))
|
||||
MakeRequest(t, req, http.StatusUnauthorized)
|
||||
|
||||
req = NewRequestWithBody(t, "POST", url+"/login", strings.NewReader("")).
|
||||
AddBasicAuth(user.Name)
|
||||
MakeRequest(t, req, http.StatusOK)
|
||||
})
|
||||
|
||||
t.Run("CheckAcceptMediaType", func(t *testing.T) {
|
||||
defer tests.PrintCurrentTest(t)()
|
||||
|
||||
|
Reference in New Issue
Block a user