mirror of
https://github.com/sstent/go-garth-cli.git
synced 2026-01-25 16:42:48 +00:00
sync - build workin
This commit is contained in:
@@ -3,8 +3,8 @@ package client_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"go-garth/internal/api/client"
|
||||
"go-garth/internal/auth/credentials"
|
||||
"github.com/sstent/go-garth/api/client"
|
||||
"github.com/sstent/go-garth/auth/credentials"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
@@ -14,11 +14,11 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"go-garth/internal/auth/sso"
|
||||
"go-garth/internal/errors"
|
||||
types "go-garth/internal/models/types"
|
||||
shared "go-garth/shared/interfaces"
|
||||
models "go-garth/shared/models"
|
||||
"github.com/sstent/go-garth/auth/sso"
|
||||
"github.com/sstent/go-garth/errors"
|
||||
types "github.com/sstent/go-garth/models/types"
|
||||
shared "github.com/sstent/go-garth-cli/shared/interfaces"
|
||||
models "github.com/sstent/go-garth-cli/shared/models"
|
||||
)
|
||||
|
||||
// Client represents the Garmin Connect API client
|
||||
|
||||
@@ -7,12 +7,12 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"go-garth/internal/testutils"
|
||||
"github.com/sstent/go-garth/testutils"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"go-garth/internal/api/client"
|
||||
"github.com/sstent/go-garth/api/client"
|
||||
)
|
||||
|
||||
func TestClient_GetUserProfile(t *testing.T) {
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"go-garth/internal/models/types"
|
||||
"go-garth/internal/utils"
|
||||
"github.com/sstent/go-garth/models/types"
|
||||
"github.com/sstent/go-garth/utils"
|
||||
)
|
||||
|
||||
// GetOAuth1Token retrieves an OAuth1 token using the provided ticket
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"go-garth/internal/auth/oauth"
|
||||
types "go-garth/internal/models/types"
|
||||
"github.com/sstent/go-garth/auth/oauth"
|
||||
types "github.com/sstent/go-garth/models/types"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"go-garth/internal/api/client"
|
||||
"github.com/sstent/go-garth/api/client"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
types "go-garth/internal/models/types"
|
||||
shared "go-garth/shared/interfaces"
|
||||
types "github.com/sstent/go-garth/models/types"
|
||||
shared "github.com/sstent/go-garth-cli/shared/interfaces"
|
||||
)
|
||||
|
||||
// BodyBatteryReading represents a single body battery data point
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
types "go-garth/internal/models/types"
|
||||
types "github.com/sstent/go-garth/models/types"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
types "go-garth/internal/models/types"
|
||||
shared "go-garth/shared/interfaces"
|
||||
types "github.com/sstent/go-garth/models/types"
|
||||
shared "github.com/sstent/go-garth-cli/shared/interfaces"
|
||||
)
|
||||
|
||||
// DailyHRVDataWithMethods embeds types.DailyHRVData and adds methods
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
shared "go-garth/shared/interfaces"
|
||||
types "go-garth/internal/models/types"
|
||||
shared "github.com/sstent/go-garth-cli/shared/interfaces"
|
||||
types "github.com/sstent/go-garth/models/types"
|
||||
)
|
||||
|
||||
// DailySleepDTO represents daily sleep data
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
types "go-garth/internal/models/types"
|
||||
shared "go-garth/shared/interfaces"
|
||||
types "github.com/sstent/go-garth/models/types"
|
||||
shared "github.com/sstent/go-garth-cli/shared/interfaces"
|
||||
)
|
||||
|
||||
// DetailedSleepDataWithMethods embeds types.DetailedSleepData and adds methods
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
types "go-garth/internal/models/types"
|
||||
shared "go-garth/shared/interfaces"
|
||||
types "github.com/sstent/go-garth/models/types"
|
||||
shared "github.com/sstent/go-garth-cli/shared/interfaces"
|
||||
)
|
||||
|
||||
// TrainingStatusWithMethods embeds types.TrainingStatus and adds methods
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
shared "go-garth/shared/interfaces"
|
||||
types "go-garth/internal/models/types"
|
||||
shared "github.com/sstent/go-garth-cli/shared/interfaces"
|
||||
types "github.com/sstent/go-garth/models/types"
|
||||
)
|
||||
|
||||
// VO2MaxData implements the Data interface for VO2 max retrieval
|
||||
|
||||
@@ -4,8 +4,9 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"go-garth/internal/api/client"
|
||||
"go-garth/internal/models"
|
||||
types "github.com/sstent/go-garth/models/types"
|
||||
"github.com/sstent/go-garth-cli/shared/interfaces"
|
||||
"github.com/sstent/go-garth-cli/shared/models"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
@@ -14,9 +15,9 @@ func TestVO2MaxData_Get(t *testing.T) {
|
||||
// Setup
|
||||
runningVO2 := 45.0
|
||||
cyclingVO2 := 50.0
|
||||
settings := &client.UserSettings{
|
||||
settings := &models.UserSettings{
|
||||
ID: 12345,
|
||||
UserData: client.UserData{
|
||||
UserData: models.UserData{
|
||||
VO2MaxRunning: &runningVO2,
|
||||
VO2MaxCycling: &cyclingVO2,
|
||||
},
|
||||
@@ -25,14 +26,14 @@ func TestVO2MaxData_Get(t *testing.T) {
|
||||
vo2Data := NewVO2MaxData()
|
||||
|
||||
// Mock the get function
|
||||
vo2Data.GetFunc = func(day time.Time, c *client.Client) (interface{}, error) {
|
||||
vo2Profile := &models.VO2MaxProfile{
|
||||
vo2Data.GetFunc = func(day time.Time, c interfaces.APIClient) (interface{}, error) {
|
||||
vo2Profile := &types.VO2MaxProfile{
|
||||
UserProfilePK: settings.ID,
|
||||
LastUpdated: time.Now(),
|
||||
}
|
||||
|
||||
if settings.UserData.VO2MaxRunning != nil && *settings.UserData.VO2MaxRunning > 0 {
|
||||
vo2Profile.Running = &models.VO2MaxEntry{
|
||||
vo2Profile.Running = &types.VO2MaxEntry{
|
||||
Value: *settings.UserData.VO2MaxRunning,
|
||||
ActivityType: "running",
|
||||
Date: day,
|
||||
@@ -41,7 +42,7 @@ func TestVO2MaxData_Get(t *testing.T) {
|
||||
}
|
||||
|
||||
if settings.UserData.VO2MaxCycling != nil && *settings.UserData.VO2MaxCycling > 0 {
|
||||
vo2Profile.Cycling = &models.VO2MaxEntry{
|
||||
vo2Profile.Cycling = &types.VO2MaxEntry{
|
||||
Value: *settings.UserData.VO2MaxCycling,
|
||||
ActivityType: "cycling",
|
||||
Date: day,
|
||||
@@ -58,7 +59,7 @@ func TestVO2MaxData_Get(t *testing.T) {
|
||||
assert.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
|
||||
profile, ok := result.(*models.VO2MaxProfile)
|
||||
profile, ok := result.(*types.VO2MaxProfile)
|
||||
assert.True(t, ok)
|
||||
assert.Equal(t, 12345, profile.UserProfilePK)
|
||||
assert.NotNil(t, profile.Running)
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
shared "go-garth/shared/interfaces"
|
||||
shared "github.com/sstent/go-garth-cli/shared/interfaces"
|
||||
)
|
||||
|
||||
// WeightData represents weight data
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"go-garth/internal/api/client"
|
||||
"go-garth/internal/utils"
|
||||
"github.com/sstent/go-garth/api/client"
|
||||
"github.com/sstent/go-garth/utils"
|
||||
)
|
||||
|
||||
type Stats interface {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"io"
|
||||
"net/url"
|
||||
|
||||
"go-garth/internal/api/client"
|
||||
"github.com/sstent/go-garth/api/client"
|
||||
)
|
||||
|
||||
// MockClient simulates API client for tests
|
||||
|
||||
@@ -3,7 +3,7 @@ package users
|
||||
import (
|
||||
"time"
|
||||
|
||||
"go-garth/internal/api/client"
|
||||
"github.com/sstent/go-garth/api/client"
|
||||
)
|
||||
|
||||
type PowerFormat struct {
|
||||
|
||||
Reference in New Issue
Block a user