Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed May 19, 2020
1 parent 087e1bf commit f2f105a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/loadpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ func TestInitialUpdate(t *testing.T) {
cm.EXPECT().CurrentPower().Return(minPower, nil)
}

// syncSettings
if tc.status != api.StatusA {
wb.EXPECT().Enabled().Return(true, nil)
}

// disable if not connected
if tc.mode == api.ModeOff {
wb.EXPECT().Enable(false)
Expand Down Expand Up @@ -262,6 +267,7 @@ func TestImmediateOnOff(t *testing.T) {
wb.EXPECT().MaxCurrent(lpMaxCurrent)
}

wb.EXPECT().Enabled().Return(true, nil) // syncSettings
lp.update()

// max current if connected & mode now
Expand Down Expand Up @@ -294,6 +300,7 @@ func TestImmediateOnOff(t *testing.T) {

wb.EXPECT().MaxCurrent(2 * lpMinCurrent)

wb.EXPECT().Enabled().Return(true, nil) // syncSettings
lp.update()

// -- round 3
Expand All @@ -310,6 +317,8 @@ func TestImmediateOnOff(t *testing.T) {
wb.EXPECT().MaxCurrent(lpMinCurrent)

lp.SetMode(api.ModeOff)

wb.EXPECT().Enabled().Return(true, nil) // syncSettings
lp.update()

ctrl.Finish()
Expand Down

0 comments on commit f2f105a

Please sign in to comment.