mirror of
https://github.com/gfleury/go-bitbucket-v1.git
synced 2025-04-05 09:18:07 -05:00
Including basic test
This commit is contained in:
parent
f350c54008
commit
1713871196
@ -124,7 +124,7 @@ func TestDefaultApiService_AddUserToGroups(t *testing.T) {
|
|||||||
client *APIClient
|
client *APIClient
|
||||||
}
|
}
|
||||||
type args struct {
|
type args struct {
|
||||||
name string
|
name string
|
||||||
groups []string
|
groups []string
|
||||||
}
|
}
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
@ -1849,6 +1849,45 @@ func TestDefaultApiService_EnableHook_4(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestDefaultApiService_EnableHook_4_WithOptions(t *testing.T) {
|
||||||
|
type fields struct {
|
||||||
|
client *APIClient
|
||||||
|
}
|
||||||
|
type args struct {
|
||||||
|
projectKey string
|
||||||
|
hookKey string
|
||||||
|
localVarOptionals map[string]interface{}
|
||||||
|
localVarPostBody map[string]interface{}
|
||||||
|
}
|
||||||
|
tests := []struct {
|
||||||
|
name string
|
||||||
|
fields fields
|
||||||
|
args args
|
||||||
|
want *APIResponse
|
||||||
|
wantErr, integrationTest bool
|
||||||
|
}{
|
||||||
|
{"networkErrorContextExceeded", fields{client: generateConfigFake()}, args{}, &APIResponse{Message: "Put https://stash.domain.com/rest/api/1.0/projects//settings/hooks//enabled: context canceled"}, true, false},
|
||||||
|
}
|
||||||
|
for _, tt := range tests {
|
||||||
|
if tt.integrationTest != runIntegrationTests {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
a := &DefaultApiService{
|
||||||
|
client: tt.fields.client,
|
||||||
|
}
|
||||||
|
got, err := a.EnableHook_4_WithOptions(tt.args.projectKey, tt.args.hookKey, tt.args.localVarOptionals, tt.args.localVarPostBody)
|
||||||
|
if (err != nil) != tt.wantErr {
|
||||||
|
t.Errorf("DefaultApiService.EnableHook_4_WithOptions() error = %v, wantErr %v", err, tt.wantErr)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !reflect.DeepEqual(got, tt.want) {
|
||||||
|
t.Errorf("DefaultApiService.EnableHook_4_WithOptions() = %v, want %v", got, tt.want)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestDefaultApiService_FindGroupsForUser(t *testing.T) {
|
func TestDefaultApiService_FindGroupsForUser(t *testing.T) {
|
||||||
type fields struct {
|
type fields struct {
|
||||||
client *APIClient
|
client *APIClient
|
||||||
|
Loading…
x
Reference in New Issue
Block a user