Add depot, attendant, jetfire, optimus, ota services with kustomize overlays
This commit is contained in:
28
services/attendant/handlers/update_approve_test.go
Normal file
28
services/attendant/handlers/update_approve_test.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package handlers_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/fiskerinc/cloud-services/services/attendant/handlers"
|
||||
"github.com/fiskerinc/cloud-services/services/attendant/services"
|
||||
|
||||
"github.com/fiskerinc/cloud-services/pkg/redis/tester"
|
||||
"github.com/fiskerinc/cloud-services/pkg/testhelper"
|
||||
)
|
||||
|
||||
func TestApproveUpdate(t *testing.T) {
|
||||
mockRedis := &tester.MockRedis{}
|
||||
services.SetRedisClientPool(tester.NewMockClientPool(mockRedis))
|
||||
|
||||
data := []byte(`{"id": 1}`)
|
||||
|
||||
err := handlers.ApproveUpdate(mockDB, "FISKER123", data)
|
||||
if err != nil {
|
||||
t.Errorf(testhelper.TestErrorTemplate, "ApproveUpdate", "no error", err)
|
||||
}
|
||||
|
||||
err = handlers.ApproveUpdate(mockDB, "FISKER123", nil)
|
||||
if err == nil {
|
||||
t.Errorf(testhelper.TestErrorTemplate, "ApproveUpdate", "error", err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user