Skip to content

Commit

Permalink
Avoid calling GCP API in tests
Browse files Browse the repository at this point in the history
Instantiating a computeDir calls List to check that it's accessible. Use
a static check to confirm it's a Parent instead.

Signed-off-by: Michael Smith <[email protected]>
  • Loading branch information
MikaelSmith committed Mar 31, 2020
1 parent ad1749f commit 423175f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
2 changes: 2 additions & 0 deletions plugin/gcp/computeDir.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ type computeDir struct {
service computeProjectService
}

var _ = plugin.Parent(&computeDir{})

const computeScope = compute.CloudPlatformScope

func newComputeDir(ctx context.Context, client *http.Client, projID string) (*computeDir, error) {
Expand Down
19 changes: 0 additions & 19 deletions plugin/gcp/computeDir_test.go

This file was deleted.

0 comments on commit 423175f

Please sign in to comment.