Skip to content

Commit

Permalink
reorder
Browse files Browse the repository at this point in the history
  • Loading branch information
okokes-akamai committed Feb 8, 2024
1 parent ed3d128 commit 9be9143
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions cloud/linode/fake_linode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,26 +251,6 @@ func (f *fakeAPI) setupRoutes() {
}
})

f.mux.HandleFunc("DELETE /v4/nodebalancers/{nodeBalancerId}", func(w http.ResponseWriter, r *http.Request) {
delete(f.nb, r.PathValue("nodeBalancerId"))
nid, err := strconv.Atoi(r.PathValue("nodeBalancerId"))
if err != nil {
f.t.Fatal(err)
}

for k, c := range f.nbc {
if c.NodeBalancerID == nid {
delete(f.nbc, k)
}
}

for k, n := range f.nbn {
if n.NodeBalancerID == nid {
delete(f.nbn, k)
}
}
})

f.mux.HandleFunc("POST /v4/nodebalancers", func(w http.ResponseWriter, r *http.Request) {
nbco := linodego.NodeBalancerCreateOptions{}
if err := json.NewDecoder(r.Body).Decode(&nbco); err != nil {
Expand Down Expand Up @@ -505,6 +485,26 @@ func (f *fakeAPI) setupRoutes() {
_, _ = w.Write(resp)
})

f.mux.HandleFunc("DELETE /v4/nodebalancers/{nodeBalancerId}", func(w http.ResponseWriter, r *http.Request) {
delete(f.nb, r.PathValue("nodeBalancerId"))
nid, err := strconv.Atoi(r.PathValue("nodeBalancerId"))
if err != nil {
f.t.Fatal(err)
}

for k, c := range f.nbc {
if c.NodeBalancerID == nid {
delete(f.nbc, k)
}
}

for k, n := range f.nbn {
if n.NodeBalancerID == nid {
delete(f.nbn, k)
}
}
})

f.mux.HandleFunc("DELETE /v4/nodebalancers/{nodeBalancerId}/configs/{configId}/nodes/{nodeId}", func(w http.ResponseWriter, r *http.Request) {
delete(f.nbn, r.PathValue("nodeId"))
})
Expand Down

0 comments on commit 9be9143

Please sign in to comment.