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
All checks were successful
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Successful in 24s
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user