test(backend): gcs
parent
c7b795e608
commit
7e805feb5a
|
@ -5,6 +5,7 @@ import (
|
|||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
|
@ -34,6 +35,8 @@ func TestGSBackendInvalid(t *testing.T) {
|
|||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
_ = os.Setenv("GOOGLE_APPLICATION_CREDENTIALS", "testdata/gcp_application_default_credentials.json")
|
||||
|
||||
got, err := NewGSReader(tt.args.path)
|
||||
if err.Error() != tt.wantErr.Error() {
|
||||
t.Errorf("NewGSReader() error = '%s', wantErr '%s'", err, tt.wantErr)
|
||||
|
|
7
pkg/iac/terraform/state/backend/testdata/gcp_application_default_credentials.json
vendored
Normal file
7
pkg/iac/terraform/state/backend/testdata/gcp_application_default_credentials.json
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"client_id": "testdata.driftctl.apps.googleusercontent.com",
|
||||
"client_secret": "fake-secret",
|
||||
"quota_project_id": "fake-project-id",
|
||||
"refresh_token": "fake-token",
|
||||
"type": "authorized_user"
|
||||
}
|
Loading…
Reference in New Issue