Remove unused code
This commit is contained in:
parent
0360a72f17
commit
b08c9be9a6
@ -1,29 +0,0 @@
|
|||||||
package testtools
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/cyrilix/robocar-base/mqttdevice"
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestFakePublisher_Publish(t *testing.T) {
|
|
||||||
p := NewFakePublisher()
|
|
||||||
|
|
||||||
cases := []struct {
|
|
||||||
topic string
|
|
||||||
topicPublished string
|
|
||||||
value mqttdevice.MqttValue
|
|
||||||
expected string
|
|
||||||
}{
|
|
||||||
{"test/topic1", "test/topic1", mqttdevice.NewMqttValue(1), "1"},
|
|
||||||
{"test/topic2", "test/invalid", mqttdevice.NewMqttValue(1), ""},
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, c := range cases {
|
|
||||||
p.Publish(c.topic, c.value)
|
|
||||||
val := p.PublishedEvent(c.topicPublished)
|
|
||||||
if v, _ := val.StringValue(); v != c.expected {
|
|
||||||
t.Errorf("FakePublisher.Publish(%v, %v): %v, wants %v", c.topic, string(c.value), v, c.expected)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user