Initial cloud-services repo - gateway service + pkg modules

This commit is contained in:
Chris Rai
2026-01-30 23:14:52 -05:00
commit fbb820d7b3
1037 changed files with 171318 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
package health_test
import (
"context"
"testing"
"fiskerinc.com/modules/health"
"fiskerinc.com/modules/testhelper"
"github.com/pkg/errors"
)
func TestTmobileCheck(t *testing.T) {
mock := MockTmobile{}
fn := func() (health.TmobileConnCheckInterface, error) {
return &mock, nil
}
check := health.NewTmobileCheck(fn)
err := check(context.Background())
testhelper.NoError(t, "No error", err)
mock.PingError = errors.New("ping error")
err = check(context.Background())
testhelper.Error(t, "Ping error", err)
}
type MockTmobile struct {
PingError error
}
func (m *MockTmobile) Ping(ctx context.Context) error {
return m.PingError
}