tests: implement HasHealth for mock health
This commit is contained in:
parent
ba1ddd2238
commit
c84998e996
|
@ -76,6 +76,12 @@ func (m *mockHealthSetter) ClearHealth() {
|
||||||
m.taskEvents = nil
|
m.taskEvents = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *mockHealthSetter) HasHealth() bool {
|
||||||
|
m.mu.Lock()
|
||||||
|
defer m.mu.Unlock()
|
||||||
|
return m.healthy != nil
|
||||||
|
}
|
||||||
|
|
||||||
// TestHealthHook_PrerunPostrun asserts a health hook does not error if it is
|
// TestHealthHook_PrerunPostrun asserts a health hook does not error if it is
|
||||||
// run and postrunned.
|
// run and postrunned.
|
||||||
func TestHealthHook_PrerunPostrun(t *testing.T) {
|
func TestHealthHook_PrerunPostrun(t *testing.T) {
|
||||||
|
|
Loading…
Reference in a new issue