Skip to content

Commit

Permalink
fix merge and copy pasta things
Browse files Browse the repository at this point in the history
  • Loading branch information
1riatsila1 committed Nov 14, 2024
1 parent f9f5796 commit f061a00
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions test/mocked/resources/agent_group_assignment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ func TestAgentGroupAssignmentResource(t *testing.T) {
mockOAuth.Mock.Disable()
}

func TestAgentGroupAssignmentResourcemockTooManyRequestsHandling(t *testing.T) {
func TestAgentGroupAssignmentResourceTooManyRequestsHandling(t *testing.T) {
defer gock.Off()
mockOAuth := util.MockOAuth()
var mockTooManyRequests *gock.Response
Expand Down Expand Up @@ -513,7 +513,7 @@ func TestAgentGroupAssignmentResourcemockTooManyRequestsHandling(t *testing.T) {
)
util.MockDeleteGroup("group_id", 1)
util.MockDeleteAgent("agent_id", 1)
mockTooManyRequests = gock.New("https://test.api.capenetworks.com").
mockTooManyRequests = gock.New("https://test.api.capenetworks.com").
Delete("/networking-uxi/v1alpha1/agent-group-assignments/agent_group_assignment_id").
Reply(http.StatusTooManyRequests).
SetHeaders(util.RateLimitingHeaders)
Expand Down
4 changes: 2 additions & 2 deletions test/mocked/resources/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func TestAgentResource(t *testing.T) {
mockOAuth.Mock.Disable()
}

func TestAgentResourcemockTooManyRequestsHandling(t *testing.T) {
func TestAgentResourceTooManyRequestsHandling(t *testing.T) {
defer gock.Off()
mockOAuth := util.MockOAuth()
var mockTooManyRequests *gock.Response
Expand Down Expand Up @@ -229,7 +229,7 @@ func TestAgentResourcemockTooManyRequestsHandling(t *testing.T) {
[]map[string]interface{}{util.GenerateAgentResponseModel("id", "")}),
1,
)
request429 = gock.New("https://test.api.capenetworks.com").
mockTooManyRequests = gock.New("https://test.api.capenetworks.com").
Delete("/networking-uxi/v1alpha1/agents/id").
Reply(http.StatusTooManyRequests).
SetHeaders(util.RateLimitingHeaders)
Expand Down
7 changes: 3 additions & 4 deletions test/mocked/resources/group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,10 @@ func TestRootGroupResource(t *testing.T) {
mockOAuth.Mock.Disable()
}

func TestGroupResourcemockTooManyRequestsHandling(t *testing.T) {
func TestGroupResourceTooManyRequestsHandling(t *testing.T) {
defer gock.Off()
mockOAuth := util.MockOAuth()
var mockTooManyRequests *gock.Response
var updateTooManyRequests *gock.Response

resource.Test(t, resource.TestCase{
ProtoV6ProviderFactories: provider.TestAccProtoV6ProviderFactories,
Expand Down Expand Up @@ -391,7 +390,7 @@ func TestGroupResourcemockTooManyRequestsHandling(t *testing.T) {
1,
)
// new group
update429 = gock.New("https://test.api.capenetworks.com").
mockTooManyRequests = gock.New("https://test.api.capenetworks.com").
Patch("/networking-uxi/v1alpha1/groups/id").
Reply(http.StatusTooManyRequests).
SetHeaders(util.RateLimitingHeaders)
Expand Down Expand Up @@ -427,7 +426,7 @@ func TestGroupResourcemockTooManyRequestsHandling(t *testing.T) {
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr("uxi_group.my_group", "name", "name_2"),
func(s *terraform.State) error {
st.Assert(t, updateTooManyRequests.Mock.Request().Counter, 0)
st.Assert(t, mockTooManyRequests.Mock.Request().Counter, 0)
return nil
},
),
Expand Down
4 changes: 2 additions & 2 deletions test/mocked/resources/network_group_assignment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ func TestNetworkGroupAssignmentResourceForWirelessNetwork(t *testing.T) {
mockOAuth.Mock.Disable()
}

func TestNetworkGroupAssignmentResourcemockTooManyRequestsHandling(t *testing.T) {
func TestNetworkGroupAssignmentResourceTooManyRequestsHandling(t *testing.T) {
defer gock.Off()
mockOAuth := util.MockOAuth()
var mockTooManyRequests *gock.Response
Expand Down Expand Up @@ -849,7 +849,7 @@ func TestNetworkGroupAssignmentResourcemockTooManyRequestsHandling(t *testing.T)
)

util.MockDeleteGroup("group_id", 1)
mock429 = gock.New("https://test.api.capenetworks.com").
mockTooManyRequests = gock.New("https://test.api.capenetworks.com").
Delete("/networking-uxi/v1alpha1/network-group-assignments/network_group_assignment_id").
Reply(http.StatusTooManyRequests).
SetHeaders(util.RateLimitingHeaders)
Expand Down
4 changes: 2 additions & 2 deletions test/mocked/resources/sensor_group_assignment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ func TestSensorGroupAssignmentResource(t *testing.T) {
mockOAuth.Mock.Disable()
}

func TestSensorGroupAssignmentResourcemockTooManyRequestsHandling(t *testing.T) {
func TestSensorGroupAssignmentResourceTooManyRequestsHandling(t *testing.T) {
defer gock.Off()
mockOAuth := util.MockOAuth()
var mockTooManyRequests *gock.Response
Expand Down Expand Up @@ -470,7 +470,7 @@ func TestSensorGroupAssignmentResourcemockTooManyRequestsHandling(t *testing.T)
)

util.MockDeleteGroup("group_id", 1)
mock429 = gock.New("https://test.api.capenetworks.com").
mockTooManyRequests = gock.New("https://test.api.capenetworks.com").
Delete("/networking-uxi/v1alpha1/sensor-group-assignments/sensor_group_assignment_id").
Reply(http.StatusTooManyRequests).
SetHeaders(util.RateLimitingHeaders)
Expand Down
4 changes: 2 additions & 2 deletions test/mocked/resources/sensor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func TestSensorResource(t *testing.T) {
mockOAuth.Mock.Disable()
}

func TestSensorResourcemockTooManyRequestsHandling(t *testing.T) {
func TestSensorResourceTooManyRequestsHandling(t *testing.T) {
defer gock.Off()
mockOAuth := util.MockOAuth()
var mockTooManyRequests *gock.Response
Expand Down Expand Up @@ -207,7 +207,7 @@ func TestSensorResourcemockTooManyRequestsHandling(t *testing.T) {
[]map[string]interface{}{util.GenerateSensorResponseModel("id", "")}),
1,
)
request429 = gock.New("https://test.api.capenetworks.com").
mockTooManyRequests = gock.New("https://test.api.capenetworks.com").
Patch("/networking-uxi/v1alpha1/sensors/id").
Reply(http.StatusTooManyRequests).
SetHeaders(util.RateLimitingHeaders)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func TestServiceTestGroupAssignmentResource(t *testing.T) {
mockOAuth.Mock.Disable()
}

func TestServiceTestGroupAssignmentResourcemockTooManyRequestsHandling(t *testing.T) {
func TestServiceTestGroupAssignmentResourceTooManyRequestsHandling(t *testing.T) {
defer gock.Off()
mockOAuth := util.MockOAuth()
var mockTooManyRequests *gock.Response
Expand Down

0 comments on commit f061a00

Please sign in to comment.