-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a bunch of static fixture tests to make it clear that these val…
…ues must be exported by the library. Also tweaked comments. Both these changes make GoLand stop raising warnings.
- Loading branch information
1 parent
bb37160
commit c175470
Showing
4 changed files
with
127 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
package rediscloud_api | ||
|
||
import ( | ||
"github.com/RedisLabs/rediscloud-go-api/service/cloud_accounts" | ||
"github.com/RedisLabs/rediscloud-go-api/service/databases" | ||
"github.com/RedisLabs/rediscloud-go-api/service/subscriptions" | ||
"github.com/stretchr/testify/assert" | ||
"testing" | ||
) | ||
|
||
func TestSubcriptionFixtures(t *testing.T) { | ||
assert.Equal(t, "active", subscriptions.SubscriptionStatusActive) | ||
assert.Equal(t, "pending", subscriptions.SubscriptionStatusPending) | ||
assert.Equal(t, "error", subscriptions.SubscriptionStatusError) | ||
assert.Equal(t, "deleting", subscriptions.SubscriptionStatusDeleting) | ||
|
||
assert.Equal(t, "initiating-request", subscriptions.VPCPeeringStatusInitiatingRequest) | ||
assert.Equal(t, "active", subscriptions.VPCPeeringStatusActive) | ||
assert.Equal(t, "inactive", subscriptions.VPCPeeringStatusInactive) | ||
assert.Equal(t, "pending-acceptance", subscriptions.VPCPeeringStatusPendingAcceptance) | ||
assert.Equal(t, "failed", subscriptions.VPCPeeringStatusFailed) | ||
|
||
assert.Equal(t, "single-region", subscriptions.SubscriptionDeploymentTypeSingleRegion) | ||
assert.Equal(t, "active-active", subscriptions.SubscriptionDeploymentTypeActiveActive) | ||
} | ||
|
||
func TestDatabaseFixtures(t *testing.T) { | ||
assert.Equal(t, "active", databases.StatusActive) | ||
assert.Equal(t, "draft", databases.StatusDraft) | ||
assert.Equal(t, "pending", databases.StatusPending) | ||
assert.Equal(t, "rcp-change-pending", databases.StatusRCPChangePending) | ||
assert.Equal(t, "rcp-draft", databases.StatusRCPDraft) | ||
assert.Equal(t, "rcp-active-change-draft", databases.StatusRCPActiveChangeDraft) | ||
assert.Equal(t, "active-change-draft", databases.StatusActiveChangeDraft) | ||
assert.Equal(t, "active-change-pending", databases.StatusActiveChangePending) | ||
|
||
assert.Equal(t, "proxy-policy-change-pending", databases.StatusProxyPolicyChangePending) | ||
assert.Equal(t, "proxy-policy-change-draft", databases.StatusProxyPolicyChangeDraft) | ||
assert.Equal(t, "error", databases.StatusError) | ||
|
||
assert.Equal(t, []string{databases.MemoryStorageRam, databases.MemoryStorageRamAndFlash}, databases.MemoryStorageValues()) | ||
assert.Equal(t, []string{"redis", "memcached"}, databases.ProtocolValues()) | ||
assert.Equal(t, []string{ | ||
"none", | ||
"aof-every-1-second", | ||
"aof-every-write", | ||
"snapshot-every-1-hour", | ||
"snapshot-every-6-hours", | ||
"snapshot-every-12-hours", | ||
}, databases.DataPersistenceValues()) | ||
assert.Equal(t, []string{ | ||
"allkeys-lru", | ||
"allkeys-lfu", | ||
"allkeys-random", | ||
"volatile-lru", | ||
"volatile-lfu", | ||
"volatile-random", | ||
"volatile-ttl", | ||
"noeviction", | ||
}, databases.DataEvictionPolicyValues()) | ||
assert.Equal(t, []string{ | ||
"http", | ||
"redis", | ||
"ftp", | ||
"aws-s3", | ||
"azure-blob-storage", | ||
"google-blob-storage", | ||
}, databases.SourceTypeValues()) | ||
assert.Equal(t, []string{ | ||
"dataset-size", | ||
"throughput-higher-than", | ||
"throughput-lower-than", | ||
"latency", | ||
"syncsource-error", | ||
"syncsource-lag", | ||
}, databases.AlertNameValues()) | ||
assert.Equal(t, []string{ | ||
"ftp", | ||
"aws-s3", | ||
"azure-blob-storage", | ||
"google-blob-storage", | ||
}, databases.BackupStorageTypes()) | ||
assert.Equal(t, []string{ | ||
databases.BackupIntervalEvery24Hours, | ||
databases.BackupIntervalEvery12Hours, | ||
databases.BackupIntervalEvery6Hours, | ||
databases.BackupIntervalEvery4Hours, | ||
databases.BackupIntervalEvery2Hours, | ||
databases.BackupIntervalEvery1Hours, | ||
}, databases.BackupIntervals()) | ||
} | ||
|
||
func TestCloudAccountFixtures(t *testing.T) { | ||
assert.Equal(t, "active", cloud_accounts.StatusActive) | ||
assert.Equal(t, "draft", cloud_accounts.StatusDraft) | ||
assert.Equal(t, "change-draft", cloud_accounts.StatusChangeDraft) | ||
assert.Equal(t, "error", cloud_accounts.StatusError) | ||
assert.Equal(t, []string{"AWS", "GCP"}, cloud_accounts.ProviderValues()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters