Enhance documentation for API client and vehicle structures; improve test function naming for clarity
All checks were successful
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Successful in 24s

This commit is contained in:
2025-07-06 15:15:12 -04:00
parent d8cf2c3fd7
commit 3c927fd83b
7 changed files with 61 additions and 64 deletions

View File

@ -11,7 +11,7 @@ import (
"git.savin.nyc/alex/mysubaru/config"
)
func makeConfig(t *testing.T) *config.Config {
func mockConfig(t *testing.T) *config.Config {
return &config.Config{
MySubaru: config.MySubaru{
Credentials: config.Credentials{
@ -29,6 +29,7 @@ func makeConfig(t *testing.T) *config.Config {
}
}
// mockMySubaruApi creates a mock MySubaru API server for testing.
func mockMySubaruApi(t *testing.T, handler http.HandlerFunc) *httptest.Server {
// Create a listener with the desired port
@ -176,7 +177,7 @@ func TestNew_Success(t *testing.T) {
ts.Start()
defer ts.Close()
cfg := makeConfig(t)
cfg := mockConfig(t)
msc, err := New(cfg)
if err != nil {
@ -235,7 +236,7 @@ func TestSelectVehicle_Success(t *testing.T) {
ts.Start()
defer ts.Close()
cfg := makeConfig(t)
cfg := mockConfig(t)
msc, err := New(cfg)
if err != nil {
@ -309,7 +310,7 @@ func TestGetVehicleByVin_Success(t *testing.T) {
ts.Start()
defer ts.Close()
cfg := makeConfig(t)
cfg := mockConfig(t)
msc, err := New(cfg)
if err != nil {