mirror of
https://github.com/pgsty/minio.git
synced 2026-08-09 15:53:28 +03:00
gcs: Check if the given project id argument exists (#4583)
Using GCS resource manager API, check if the provided project id is already created and associated to the current user account.
This commit is contained in:
committed by
Harshavardhana
parent
6b70f429ed
commit
eaa41e4086
@@ -66,8 +66,8 @@ func TestToGCSPageToken(t *testing.T) {
|
||||
|
||||
}
|
||||
|
||||
// TestValidGCSProjectID tests the behavior of isValidGCSProjectID
|
||||
func TestValidGCSProjectID(t *testing.T) {
|
||||
// TestIsValidGCSProjectIDFormat tests isValidGCSProjectIDFormat
|
||||
func TestValidGCSProjectIDFormat(t *testing.T) {
|
||||
testCases := []struct {
|
||||
ProjectID string
|
||||
Valid bool
|
||||
@@ -93,8 +93,9 @@ func TestValidGCSProjectID(t *testing.T) {
|
||||
}
|
||||
|
||||
for i, testCase := range testCases {
|
||||
if isValidGCSProjectID(testCase.ProjectID) != testCase.Valid {
|
||||
t.Errorf("Test %d: Expected %v, got %v", i+1, isValidGCSProjectID(testCase.ProjectID), testCase.Valid)
|
||||
valid := isValidGCSProjectIDFormat(testCase.ProjectID)
|
||||
if valid != testCase.Valid {
|
||||
t.Errorf("Test %d: Expected %v, got %v", i+1, valid, testCase.Valid)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user