Add depot, attendant, jetfire, optimus, ota services with kustomize overlays

This commit is contained in:
Chris Rai
2026-01-31 15:35:07 -05:00
parent a0ec642ca1
commit 9a5cb2f547
404 changed files with 38817 additions and 16 deletions

View File

@@ -0,0 +1,37 @@
package handlers_test
import (
"fmt"
"net/http"
"testing"
"otaupdate/handlers"
"otaupdate/services"
mo "github.com/fiskerinc/cloud-services/pkg/db/queries/mocks"
th "github.com/fiskerinc/cloud-services/pkg/testhelper"
)
func TestGetVehicleModels(t *testing.T) {
mock := mo.MockCars{}
services.GetDB().SetCars(&mock)
tests := []mo.DBHttpTest{
{
Name: "Call",
Request: th.MakeTestRequest(http.MethodGet, "http://example.com/vehiclemodels", nil),
ExpectedStatus: http.StatusOK,
ExpectedResponse: `{"data":["1G1FP87S3GN100062"]}`,
},
{
Name: "Error",
Request: th.MakeTestRequest(http.MethodGet, "http://example.com/vehiclemodels", nil),
ExpectedStatus: http.StatusServiceUnavailable,
ExpectedResponse: `{"message":"something went wrong","error":"Service Unavailable"}`,
DBTestCase: mo.DBTestCase{
MockError: fmt.Errorf("something went wrong"),
},
},
}
mo.RunDBTests(t, tests, handlers.HandleVehicleModels, &mock)
}