chore: fix test
This commit is contained in:
parent
956381bd4e
commit
7a7342de2f
1 changed files with 8 additions and 1 deletions
|
|
@ -136,11 +136,18 @@ func TestRequiredBatteryMode(t *testing.T) {
|
|||
{true, api.BatteryCharge, api.BatteryUnknown}, // ignore
|
||||
}
|
||||
|
||||
{
|
||||
// no battery
|
||||
res := new(Site).requiredBatteryMode(true, api.Rate{})
|
||||
assert.Equal(t, api.BatteryUnknown, res, "expected %s, got %s", api.BatteryUnknown, res)
|
||||
}
|
||||
|
||||
for _, tc := range tc {
|
||||
t.Logf("%+v", tc)
|
||||
|
||||
s := &Site{
|
||||
batteryMode: tc.mode,
|
||||
batteryMeters: []api.Meter{nil},
|
||||
batteryMode: tc.mode,
|
||||
}
|
||||
|
||||
res := s.requiredBatteryMode(tc.gridChargeActive, api.Rate{})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue