Add new API client function to tests
This commit is contained in:
parent
7e4ec074f5
commit
08446c8fcd
1 changed files with 36 additions and 0 deletions
|
|
@ -29,6 +29,12 @@ func TestApp_Create(t *testing.T) {
|
|||
name: "create codespace with default branch and 30m idle timeout",
|
||||
fields: fields{
|
||||
apiClient: &apiClientMock{
|
||||
GetCodespacePreFlightFunc: func(ctx context.Context, nwo string) (*api.User, error) {
|
||||
return &api.User{
|
||||
Login: "monalisa",
|
||||
Type: "User",
|
||||
}, nil
|
||||
},
|
||||
GetRepositoryFunc: func(ctx context.Context, nwo string) (*api.Repository, error) {
|
||||
return &api.Repository{
|
||||
ID: 1234,
|
||||
|
|
@ -83,6 +89,12 @@ func TestApp_Create(t *testing.T) {
|
|||
GetCodespaceRegionLocationFunc: func(ctx context.Context) (string, error) {
|
||||
return "EUROPE", nil
|
||||
},
|
||||
GetCodespacePreFlightFunc: func(ctx context.Context, nwo string) (*api.User, error) {
|
||||
return &api.User{
|
||||
Login: "monalisa",
|
||||
Type: "User",
|
||||
}, nil
|
||||
},
|
||||
GetRepositoryFunc: func(ctx context.Context, nwo string) (*api.Repository, error) {
|
||||
return &api.Repository{
|
||||
ID: 1234,
|
||||
|
|
@ -134,6 +146,12 @@ func TestApp_Create(t *testing.T) {
|
|||
GetCodespaceRegionLocationFunc: func(ctx context.Context) (string, error) {
|
||||
return "EUROPE", nil
|
||||
},
|
||||
GetCodespacePreFlightFunc: func(ctx context.Context, nwo string) (*api.User, error) {
|
||||
return &api.User{
|
||||
Login: "monalisa",
|
||||
Type: "User",
|
||||
}, nil
|
||||
},
|
||||
GetRepositoryFunc: func(ctx context.Context, nwo string) (*api.Repository, error) {
|
||||
return &api.Repository{
|
||||
ID: 1234,
|
||||
|
|
@ -190,6 +208,12 @@ func TestApp_Create(t *testing.T) {
|
|||
GetCodespaceRegionLocationFunc: func(ctx context.Context) (string, error) {
|
||||
return "EUROPE", nil
|
||||
},
|
||||
GetCodespacePreFlightFunc: func(ctx context.Context, nwo string) (*api.User, error) {
|
||||
return &api.User{
|
||||
Login: "monalisa",
|
||||
Type: "User",
|
||||
}, nil
|
||||
},
|
||||
GetRepositoryFunc: func(ctx context.Context, nwo string) (*api.Repository, error) {
|
||||
return &api.Repository{
|
||||
ID: 1234,
|
||||
|
|
@ -218,6 +242,12 @@ func TestApp_Create(t *testing.T) {
|
|||
GetCodespaceRegionLocationFunc: func(ctx context.Context) (string, error) {
|
||||
return "EUROPE", nil
|
||||
},
|
||||
GetCodespacePreFlightFunc: func(ctx context.Context, nwo string) (*api.User, error) {
|
||||
return &api.User{
|
||||
Login: "monalisa",
|
||||
Type: "User",
|
||||
}, nil
|
||||
},
|
||||
GetRepositoryFunc: func(ctx context.Context, nwo string) (*api.Repository, error) {
|
||||
return &api.Repository{
|
||||
ID: 1234,
|
||||
|
|
@ -268,6 +298,12 @@ func TestApp_Create(t *testing.T) {
|
|||
name: "create codespace that requires accepting additional permissions",
|
||||
fields: fields{
|
||||
apiClient: &apiClientMock{
|
||||
GetCodespacePreFlightFunc: func(ctx context.Context, nwo string) (*api.User, error) {
|
||||
return &api.User{
|
||||
Login: "monalisa",
|
||||
Type: "User",
|
||||
}, nil
|
||||
},
|
||||
GetRepositoryFunc: func(ctx context.Context, nwo string) (*api.Repository, error) {
|
||||
return &api.Repository{
|
||||
ID: 1234,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue