Add depot, attendant, jetfire, optimus, ota services with kustomize overlays
This commit is contained in:
33
services/ota_update_go/handlers/fleet_delete_test.go
Normal file
33
services/ota_update_go/handlers/fleet_delete_test.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package handlers_test
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"otaupdate/handlers"
|
||||
"otaupdate/services"
|
||||
|
||||
"github.com/fiskerinc/cloud-services/pkg/mongo"
|
||||
th "github.com/fiskerinc/cloud-services/pkg/testhelper"
|
||||
)
|
||||
|
||||
func TestFilterDelete(t *testing.T) {
|
||||
client, err := services.GetMongoClient()
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
mockMongo := mongo.NewVehiclesCollection(&mongo.MockCollection{})
|
||||
client.SetVehicles(mockMongo)
|
||||
|
||||
tests := []th.BasicHttpTest{
|
||||
{
|
||||
Name: "Valid data",
|
||||
Request: th.MakeTestRequest(http.MethodDelete, "http://example.com/fleet/TESTFLEET", nil),
|
||||
ExpectedStatus: http.StatusOK,
|
||||
ExpectedResponse: `{"message":"Deleted"}`,
|
||||
},
|
||||
}
|
||||
|
||||
th.RunParamHttpTests(t, tests, handlers.HandleFleetDelete, "/fleet/:name")
|
||||
}
|
||||
Reference in New Issue
Block a user