File: repository_submodules_test.go

package info (click to toggle)
golang-gitlab-gitlab-org-api-client-go 0.123.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,356 kB
  • sloc: makefile: 17
file content (51 lines) | stat: -rw-r--r-- 1,430 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package gitlab

import (
	"fmt"
	"net/http"
	"testing"

	"github.com/stretchr/testify/require"
)

func _disabled_TestRepositorySubmodulesService_UpdateSubmodule(t *testing.T) {
	mux, client := setup(t)

	mux.HandleFunc("/api/v4/projects/13083/repository/submodules/app%2Fproject", func(w http.ResponseWriter, r *http.Request) {
		testMethod(t, r, http.MethodPut)
		fmt.Fprintf(w, `
			{
			  "id": "6104942438c14ec7bd21c6cd5bd995272b3faff6",
			  "short_id": "6104942438c",
			  "title": "Update my submodule",
			  "author_name": "popdabubbles",
			  "author_email": "noty@gmail.com",
			  "committer_name": "Will",
			  "committer_email": "noty@gmail.com",
			  "message": "Update my submodule",
			  "parent_ids": [
			    "ae1d9fb46aa2b07ee9836d49862ec4e2c46fbbba"
			  ],
			  "status": "running"
			}
		`)
	})

	want := &SubmoduleCommit{
		ID:             "6104942438c14ec7bd21c6cd5bd995272b3faff6",
		ShortID:        "6104942438c",
		Title:          "Update my submodule",
		AuthorName:     "popdabubbles",
		AuthorEmail:    "noty@gmail.com",
		CommitterName:  "Will",
		CommitterEmail: "noty@gmail.com",
		Message:        "Update my submodule",
		ParentIDs:      []string{"ae1d9fb46aa2b07ee9836d49862ec4e2c46fbbba"},
		Status:         Ptr(Running),
	}

	sc, resp, err := client.RepositorySubmodules.UpdateSubmodule(13083, "app/project", nil)
	require.NoError(t, err)
	require.NotNil(t, resp)
	require.Equal(t, want, sc)
}