Skip to content

Commit

Permalink
fix: rg api tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zekisherif committed Oct 30, 2024
1 parent cf698f7 commit ceceb23
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions api/resource_groups_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,26 @@ func TestFindResourceGroupType(t *testing.T) {
assert.True(t, found, "resource group type should exist")
assert.Equal(t, "AWS", groupFound.String(), "wrong resource group type")

groupFound, found = api.FindResourceGroupType("AWS")
groupFound, found = api.FindResourceGroupType("GCP")
assert.True(t, found, "resource group type should exist")
assert.Equal(t, "AWS", groupFound.String(), "wrong resource group type")
assert.Equal(t, "GCP", groupFound.String(), "wrong resource group type")

groupFound, found = api.FindResourceGroupType("CONTAINER")
groupFound, found = api.FindResourceGroupType("AZURE")
assert.True(t, found, "resource group type should exist")
assert.Equal(t, "CONTAINER", groupFound.String(), "wrong resource group type")
assert.Equal(t, "AZURE", groupFound.String(), "wrong resource group type")

groupFound, found = api.FindResourceGroupType("GCP")
groupFound, found = api.FindResourceGroupType("CONTAINER")
assert.True(t, found, "resource group type should exist")
assert.Equal(t, "GCP", groupFound.String(), "wrong resource group type")
assert.Equal(t, "CONTAINER", groupFound.String(), "wrong resource group type")

groupFound, found = api.FindResourceGroupType("MACHINE")
assert.True(t, found, "resource group type should exist")
assert.Equal(t, "MACHINE", groupFound.String(), "wrong resource group type")

groupFound, found = api.FindResourceGroupType("OCI")
assert.True(t, found, "resource group type should exist")
assert.Equal(t, "OCI", groupFound.String(), "wrong resource group type")

groupFound, found = api.FindResourceGroupType("KUBERNETES")
assert.True(t, found, "resource group type should exist")
assert.Equal(t, "KUBERNETES", groupFound.String(), "wrong resource group type")
Expand Down Expand Up @@ -196,17 +200,17 @@ func TestResourceGroupsDelete(t *testing.T) {

func TestResourceGroupsList(t *testing.T) {
var (
awsResourceGUIDs = []string{intgguid.New(), intgguid.New()}
azureResourceGUIDs = []string{intgguid.New(), intgguid.New()}
containerResourceGUIDs = []string{intgguid.New()}
gcpResourceGUIDs = []string{intgguid.New()}
machineResourceGUIDs = []string{intgguid.New()}
ociResourceGUIDs = []string{intgguid.New()}
awsResourceGUIDs = []string{intgguid.New(), intgguid.New()}
azureResourceGUIDs = []string{intgguid.New(), intgguid.New()}
containerResourceGUIDs = []string{intgguid.New()}
gcpResourceGUIDs = []string{intgguid.New()}
machineResourceGUIDs = []string{intgguid.New()}
ociResourceGUIDs = []string{intgguid.New()}
kubernetesResourceGUIDs = []string{intgguid.New()}
allGroups = [][]string{awsResourceGUIDs, azureResourceGUIDs, containerResourceGUIDs,
allGroups = [][]string{awsResourceGUIDs, azureResourceGUIDs, containerResourceGUIDs,
gcpResourceGUIDs, machineResourceGUIDs, ociResourceGUIDs, kubernetesResourceGUIDs}
allGuids []string
fakeServer = lacework.MockServer()
allGuids []string
fakeServer = lacework.MockServer()
)

for _, guids := range allGroups {
Expand Down

0 comments on commit ceceb23

Please sign in to comment.