mirror of
https://github.com/hybridgroup/gobot.git
synced 2025-04-26 13:48:49 +08:00
aio: ensure event handler is setup before starting test
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
parent
a85a6c35f1
commit
021587e511
@ -30,12 +30,11 @@ func TestGroveTempSensorPublishesTemperatureInCelsius(t *testing.T) {
|
||||
val = 585
|
||||
return
|
||||
})
|
||||
gobottest.Assert(t, d.Start(), nil)
|
||||
|
||||
d.Once(d.Event(Data), func(data interface{}) {
|
||||
gobottest.Assert(t, fmt.Sprintf("%.2f", data.(float64)), "31.62")
|
||||
sem <- true
|
||||
})
|
||||
gobottest.Assert(t, d.Start(), nil)
|
||||
|
||||
select {
|
||||
case <-sem:
|
||||
|
Loading…
x
Reference in New Issue
Block a user