MCPcopy Index your code
hub / github.com/apache/devlake / Test_generateFakeRepoURL

Function Test_generateFakeRepoURL

backend/plugins/bamboo/tasks/shared_test.go:83–116  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

81}
82
83func Test_generateFakeRepoURL(t *testing.T) {
84 type args struct {
85 endpoint string
86 repoID int
87 }
88 tests := []struct {
89 name string
90 args args
91 want string
92 wantErr bool
93 }{
94 {
95 name: "t-1",
96 args: args{
97 endpoint: "http://127.0.0.1:8080/abc",
98 repoID: 123,
99 },
100 want: "fake://127.0.0.1:8080/repos/123",
101 wantErr: false,
102 },
103 }
104 for _, tt := range tests {
105 t.Run(tt.name, func(t *testing.T) {
106 got, err := generateFakeRepoUrl(tt.args.endpoint, tt.args.repoID)
107 if (err != nil) != tt.wantErr {
108 t.Errorf("generateFakeRepoUrl() error = %v, wantErr %v", err, tt.wantErr)
109 return
110 }
111 if got != tt.want {
112 t.Errorf("generateFakeRepoUrl() got = %v, want %v", got, tt.want)
113 }
114 })
115 }
116}

Callers

nothing calls this directly

Calls 2

generateFakeRepoUrlFunction · 0.85
RunMethod · 0.80

Tested by

no test coverage detected