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,35 @@
package handlers_test
import (
"net/http"
"testing"
"otaupdate/handlers"
"otaupdate/services"
m "github.com/fiskerinc/cloud-services/pkg/common"
"github.com/fiskerinc/cloud-services/pkg/db/queries/mocks"
th "github.com/fiskerinc/cloud-services/pkg/testhelper"
)
func TestHandleUpdateManifestSUMSGet(t *testing.T) {
mock := mocks.MockUpdateManifestVersions{}
services.GetDB().SetUpdateManifestVersions(&mock)
umvs := []m.SUMSVersion{{Version: "testv1", OSVersion: "1.2.3"}, {Version: "testv2", OSVersion: "1.2.3"}, {Version: "testv3", OSVersion: "1.2.3"}}
tests := []mocks.DBHttpTest{
{
Name: "Fetch all update manifest versions rows",
Request: th.MakeTestRequest(http.MethodGet, "/manifests/versions", nil),
ExpectedStatus: http.StatusOK,
ExpectedResponse: `{"data":[{"version":"testv1","os_version":"1.2.3"},{"version":"testv2","os_version":"1.2.3"},{"version":"testv3","os_version":"1.2.3"}],"total":3}`,
DBTestCase: mocks.DBTestCase{
SetupMockResponse: func() {
mock.SelectResponse = umvs
},
},
},
}
mocks.RunDBTests(t, tests, handlers.HandleUpdateManifestSUMSGet, &mock)
}