2014-05-03 06:22:05 +08:00
|
|
|
package pebble
|
|
|
|
|
|
|
|
import (
|
2014-06-14 05:18:57 +08:00
|
|
|
"testing"
|
2014-11-29 10:10:05 +08:00
|
|
|
|
2023-10-20 16:27:09 +08:00
|
|
|
"github.com/stretchr/testify/assert"
|
2023-11-12 21:17:02 +08:00
|
|
|
"github.com/stretchr/testify/require"
|
2023-05-20 20:25:21 +08:00
|
|
|
"gobot.io/x/gobot/v2"
|
2014-05-03 06:22:05 +08:00
|
|
|
)
|
|
|
|
|
2016-10-02 00:01:30 +08:00
|
|
|
var _ gobot.Adaptor = (*Adaptor)(nil)
|
2016-07-14 01:01:36 +08:00
|
|
|
|
2016-10-02 00:01:30 +08:00
|
|
|
func initTestAdaptor() *Adaptor {
|
|
|
|
return NewAdaptor()
|
2014-06-14 05:18:57 +08:00
|
|
|
}
|
2014-05-03 06:22:05 +08:00
|
|
|
|
2016-10-02 00:01:30 +08:00
|
|
|
func TestAdaptor(t *testing.T) {
|
|
|
|
a := initTestAdaptor()
|
2023-10-20 16:27:09 +08:00
|
|
|
assert.Equal(t, "Pebble", a.Name())
|
2014-12-18 06:04:18 +08:00
|
|
|
}
|
2023-10-21 02:50:42 +08:00
|
|
|
|
2016-10-02 00:01:30 +08:00
|
|
|
func TestAdaptorConnect(t *testing.T) {
|
|
|
|
a := initTestAdaptor()
|
2023-11-12 21:17:02 +08:00
|
|
|
require.NoError(t, a.Connect())
|
2014-06-14 05:18:57 +08:00
|
|
|
}
|
2014-06-14 07:01:39 +08:00
|
|
|
|
2016-10-02 00:01:30 +08:00
|
|
|
func TestAdaptorFinalize(t *testing.T) {
|
|
|
|
a := initTestAdaptor()
|
2023-11-12 21:17:02 +08:00
|
|
|
require.NoError(t, a.Finalize())
|
2014-06-14 05:18:57 +08:00
|
|
|
}
|