Skip to content

Commit

Permalink
fix for prescription tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jh-bate committed Nov 16, 2023
1 parent 1dffd87 commit 47b7c2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion data/types/settings/pump/test/pump.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func NewPump(unitsBloodGlucose *string) *pump.Pump {
datum.BloodGlucoseTargetPreprandial = dataBloodGlucoseTest.RandomTarget(unitsBloodGlucose)
datum.BloodGlucoseTargetSchedules = pump.NewBloodGlucoseTargetStartArrayMap()
datum.BloodGlucoseTargetSchedules.Set(scheduleName, RandomBloodGlucoseTargetStartArray(unitsBloodGlucose))
datum.Boluses = NewRandomBolusMap(2, 4)
datum.Bolus = NewRandomBolus()
datum.CarbohydrateRatioSchedules = pump.NewCarbohydrateRatioStartArrayMap()
datum.CarbohydrateRatioSchedules.Set(scheduleName, NewCarbohydrateRatioStartArray())
datum.Display = NewDisplay()
Expand Down
11 changes: 4 additions & 7 deletions prescription/test/prescription.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ import (
"fmt"
"time"

dataTypesSettingsPump "github.com/tidepool-org/platform/data/types/settings/pump"

dataBloodGlucoseTest "github.com/tidepool-org/platform/data/blood/glucose/test"
"github.com/tidepool-org/platform/data/types/settings/pump"

"github.com/google/uuid"

"github.com/tidepool-org/platform/data/blood/glucose"
testUtils "github.com/tidepool-org/platform/test"

userTest "github.com/tidepool-org/platform/user/test"

Expand Down Expand Up @@ -183,7 +180,7 @@ func RandomInitialSettings() *prescription.InitialSettings {

func RandomCalculator() *prescription.Calculator {
return &prescription.Calculator{
Method: pointer.FromString(testUtils.RandomStringFromArray(prescription.AllowedCalculatorMethods())),
Method: pointer.FromString(test.RandomStringFromArray(prescription.AllowedCalculatorMethods())),
RecommendedBasalRate: pointer.FromFloat64(test.RandomFloat64FromRange(0, 100)),
RecommendedCarbohydrateRatio: pointer.FromFloat64(test.RandomFloat64FromRange(0, 100)),
RecommendedInsulinSensitivity: pointer.FromFloat64(test.RandomFloat64FromRange(0, 100)),
Expand Down Expand Up @@ -238,10 +235,10 @@ func RandomBloodGlucoseTargetStart(startMinimum int) *pump.BloodGlucoseTargetSta

func RandomInsulinModel() *string {
validInsulinTypes := []string{
dataTypesSettingsPump.InsulinModelModelTypeRapidAdult,
dataTypesSettingsPump.InsulinModelModelTypeRapidChild,
pump.InsulinModelModelTypeRapidAdult,
pump.InsulinModelModelTypeRapidChild,
}
return pointer.FromString(testUtils.RandomStringFromArray(validInsulinTypes))
return pointer.FromString(test.RandomStringFromArray(validInsulinTypes))
}

func RandomDeviceID() string {
Expand Down

0 comments on commit 47b7c2f

Please sign in to comment.