mirror of
https://github.com/go-gitea/gitea.git
synced 2025-08-22 07:21:31 +00:00
chore: remove unwanted indentation on the line
This commit is contained in:
parent
df22b6dd12
commit
5bbbade026
@ -21,12 +21,7 @@ func TestAPICreateUserProject(t *testing.T) {
|
|||||||
defer tests.PrepareTestEnv(t)()
|
defer tests.PrepareTestEnv(t)()
|
||||||
const title, description, board_type = "project_name", "project_description", uint8(project_model.BoardTypeBasicKanban)
|
const title, description, board_type = "project_name", "project_description", uint8(project_model.BoardTypeBasicKanban)
|
||||||
|
|
||||||
token := getUserToken(
|
token := getUserToken(t, "user2", auth_model.AccessTokenScopeWriteIssue, auth_model.AccessTokenScopeWriteUser)
|
||||||
t,
|
|
||||||
"user2",
|
|
||||||
auth_model.AccessTokenScopeWriteIssue,
|
|
||||||
auth_model.AccessTokenScopeWriteUser,
|
|
||||||
)
|
|
||||||
urlStr := fmt.Sprintf("/api/v1/user/projects?token=%s", token)
|
urlStr := fmt.Sprintf("/api/v1/user/projects?token=%s", token)
|
||||||
|
|
||||||
req := NewRequestWithJSON(t, "POST", urlStr, &api.NewProjectPayload{
|
req := NewRequestWithJSON(t, "POST", urlStr, &api.NewProjectPayload{
|
||||||
@ -48,12 +43,7 @@ func TestAPICreateOrgProject(t *testing.T) {
|
|||||||
const title, description, board_type = "project_name", "project_description", uint8(project_model.BoardTypeBasicKanban)
|
const title, description, board_type = "project_name", "project_description", uint8(project_model.BoardTypeBasicKanban)
|
||||||
|
|
||||||
orgName := "org17"
|
orgName := "org17"
|
||||||
token := getUserToken(
|
token := getUserToken(t, "user2", auth_model.AccessTokenScopeWriteIssue, auth_model.AccessTokenScopeWriteOrganization)
|
||||||
t,
|
|
||||||
"user2",
|
|
||||||
auth_model.AccessTokenScopeWriteIssue,
|
|
||||||
auth_model.AccessTokenScopeWriteOrganization,
|
|
||||||
)
|
|
||||||
urlStr := fmt.Sprintf("/api/v1/orgs/%s/projects?token=%s", orgName, token)
|
urlStr := fmt.Sprintf("/api/v1/orgs/%s/projects?token=%s", orgName, token)
|
||||||
|
|
||||||
req := NewRequestWithJSON(t, "POST", urlStr, &api.NewProjectPayload{
|
req := NewRequestWithJSON(t, "POST", urlStr, &api.NewProjectPayload{
|
||||||
@ -76,12 +66,7 @@ func TestAPICreateRepoProject(t *testing.T) {
|
|||||||
|
|
||||||
ownerName := "user2"
|
ownerName := "user2"
|
||||||
repoName := "repo1"
|
repoName := "repo1"
|
||||||
token := getUserToken(
|
token := getUserToken(t, ownerName, auth_model.AccessTokenScopeWriteIssue, auth_model.AccessTokenScopeWriteOrganization)
|
||||||
t,
|
|
||||||
ownerName,
|
|
||||||
auth_model.AccessTokenScopeWriteIssue,
|
|
||||||
auth_model.AccessTokenScopeWriteOrganization,
|
|
||||||
)
|
|
||||||
urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/projects?token=%s", ownerName, repoName, token)
|
urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/projects?token=%s", ownerName, repoName, token)
|
||||||
|
|
||||||
req := NewRequestWithJSON(t, "POST", urlStr, &api.NewProjectPayload{
|
req := NewRequestWithJSON(t, "POST", urlStr, &api.NewProjectPayload{
|
||||||
@ -101,12 +86,7 @@ func TestAPICreateRepoProject(t *testing.T) {
|
|||||||
func TestAPIListUserProjects(t *testing.T) {
|
func TestAPIListUserProjects(t *testing.T) {
|
||||||
defer tests.PrepareTestEnv(t)()
|
defer tests.PrepareTestEnv(t)()
|
||||||
|
|
||||||
token := getUserToken(
|
token := getUserToken(t, "user2", auth_model.AccessTokenScopeReadUser, auth_model.AccessTokenScopeReadIssue)
|
||||||
t,
|
|
||||||
"user2",
|
|
||||||
auth_model.AccessTokenScopeReadUser,
|
|
||||||
auth_model.AccessTokenScopeReadIssue,
|
|
||||||
)
|
|
||||||
link, _ := url.Parse(fmt.Sprintf("/api/v1/user/projects"))
|
link, _ := url.Parse(fmt.Sprintf("/api/v1/user/projects"))
|
||||||
|
|
||||||
link.RawQuery = url.Values{"token": {token}}.Encode()
|
link.RawQuery = url.Values{"token": {token}}.Encode()
|
||||||
@ -123,12 +103,7 @@ func TestAPIListOrgProjects(t *testing.T) {
|
|||||||
defer tests.PrepareTestEnv(t)()
|
defer tests.PrepareTestEnv(t)()
|
||||||
|
|
||||||
orgName := "org17"
|
orgName := "org17"
|
||||||
token := getUserToken(
|
token := getUserToken(t, "user2", auth_model.AccessTokenScopeReadOrganization, auth_model.AccessTokenScopeReadIssue)
|
||||||
t,
|
|
||||||
"user2",
|
|
||||||
auth_model.AccessTokenScopeReadOrganization,
|
|
||||||
auth_model.AccessTokenScopeReadIssue,
|
|
||||||
)
|
|
||||||
link, _ := url.Parse(fmt.Sprintf("/api/v1/orgs/%s/projects", orgName))
|
link, _ := url.Parse(fmt.Sprintf("/api/v1/orgs/%s/projects", orgName))
|
||||||
|
|
||||||
link.RawQuery = url.Values{"token": {token}}.Encode()
|
link.RawQuery = url.Values{"token": {token}}.Encode()
|
||||||
@ -146,12 +121,7 @@ func TestAPIListRepoProjects(t *testing.T) {
|
|||||||
|
|
||||||
ownerName := "user2"
|
ownerName := "user2"
|
||||||
repoName := "repo1"
|
repoName := "repo1"
|
||||||
token := getUserToken(
|
token := getUserToken(t, "user2", auth_model.AccessTokenScopeReadRepository, auth_model.AccessTokenScopeReadIssue)
|
||||||
t,
|
|
||||||
"user2",
|
|
||||||
auth_model.AccessTokenScopeReadRepository,
|
|
||||||
auth_model.AccessTokenScopeReadIssue,
|
|
||||||
)
|
|
||||||
link, _ := url.Parse(fmt.Sprintf("/api/v1/repos/%s/%s/projects", ownerName, repoName))
|
link, _ := url.Parse(fmt.Sprintf("/api/v1/repos/%s/%s/projects", ownerName, repoName))
|
||||||
|
|
||||||
link.RawQuery = url.Values{"token": {token}}.Encode()
|
link.RawQuery = url.Values{"token": {token}}.Encode()
|
||||||
@ -166,12 +136,7 @@ func TestAPIListRepoProjects(t *testing.T) {
|
|||||||
|
|
||||||
func TestAPIGetProject(t *testing.T) {
|
func TestAPIGetProject(t *testing.T) {
|
||||||
defer tests.PrepareTestEnv(t)()
|
defer tests.PrepareTestEnv(t)()
|
||||||
token := getUserToken(
|
token := getUserToken(t, "user2", auth_model.AccessTokenScopeReadUser, auth_model.AccessTokenScopeReadIssue)
|
||||||
t,
|
|
||||||
"user2",
|
|
||||||
auth_model.AccessTokenScopeReadUser,
|
|
||||||
auth_model.AccessTokenScopeReadIssue,
|
|
||||||
)
|
|
||||||
link, _ := url.Parse(fmt.Sprintf("/api/v1/projects/%d", 1))
|
link, _ := url.Parse(fmt.Sprintf("/api/v1/projects/%d", 1))
|
||||||
|
|
||||||
link.RawQuery = url.Values{"token": {token}}.Encode()
|
link.RawQuery = url.Values{"token": {token}}.Encode()
|
||||||
@ -188,12 +153,7 @@ func TestAPIGetProject(t *testing.T) {
|
|||||||
|
|
||||||
func TestAPIUpdateProject(t *testing.T) {
|
func TestAPIUpdateProject(t *testing.T) {
|
||||||
defer tests.PrepareTestEnv(t)()
|
defer tests.PrepareTestEnv(t)()
|
||||||
token := getUserToken(
|
token := getUserToken(t, "user2", auth_model.AccessTokenScopeWriteUser, auth_model.AccessTokenScopeWriteIssue)
|
||||||
t,
|
|
||||||
"user2",
|
|
||||||
auth_model.AccessTokenScopeWriteUser,
|
|
||||||
auth_model.AccessTokenScopeWriteIssue,
|
|
||||||
)
|
|
||||||
link, _ := url.Parse(fmt.Sprintf("/api/v1/projects/%d", 1))
|
link, _ := url.Parse(fmt.Sprintf("/api/v1/projects/%d", 1))
|
||||||
|
|
||||||
link.RawQuery = url.Values{"token": {token}}.Encode()
|
link.RawQuery = url.Values{"token": {token}}.Encode()
|
||||||
@ -211,12 +171,7 @@ func TestAPIUpdateProject(t *testing.T) {
|
|||||||
|
|
||||||
func TestAPIDeleteProject(t *testing.T) {
|
func TestAPIDeleteProject(t *testing.T) {
|
||||||
defer tests.PrepareTestEnv(t)()
|
defer tests.PrepareTestEnv(t)()
|
||||||
token := getUserToken(
|
token := getUserToken(t, "user2", auth_model.AccessTokenScopeWriteUser, auth_model.AccessTokenScopeWriteIssue)
|
||||||
t,
|
|
||||||
"user2",
|
|
||||||
auth_model.AccessTokenScopeWriteUser,
|
|
||||||
auth_model.AccessTokenScopeWriteIssue,
|
|
||||||
)
|
|
||||||
link, _ := url.Parse(fmt.Sprintf("/api/v1/projects/%d", 1))
|
link, _ := url.Parse(fmt.Sprintf("/api/v1/projects/%d", 1))
|
||||||
|
|
||||||
link.RawQuery = url.Values{"token": {token}}.Encode()
|
link.RawQuery = url.Values{"token": {token}}.Encode()
|
||||||
|
Loading…
Reference in New Issue
Block a user