2014-11-04 10:30:56 +08:00
|
|
|
package mqtt
|
|
|
|
|
|
|
|
import (
|
2014-11-04 10:56:33 +08:00
|
|
|
"github.com/hybridgroup/gobot"
|
|
|
|
"testing"
|
2014-11-04 10:30:56 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
func initTestMqttAdaptor() *MqttAdaptor {
|
2014-11-04 10:56:33 +08:00
|
|
|
return NewMqttAdaptor("mqtt", "localhost:1883")
|
2014-11-04 10:30:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestMqttAdaptorConnect(t *testing.T) {
|
2014-11-04 10:56:33 +08:00
|
|
|
a := initTestMqttAdaptor()
|
|
|
|
gobot.Assert(t, a.Connect(), true)
|
2014-11-04 10:30:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestMqttAdaptorFinalize(t *testing.T) {
|
2014-11-04 10:56:33 +08:00
|
|
|
a := initTestMqttAdaptor()
|
|
|
|
gobot.Assert(t, a.Finalize(), true)
|
2014-11-04 10:30:56 +08:00
|
|
|
}
|