Fixed device watcher tests.

This commit is contained in:
Zach Klippenstein 2015-07-19 14:41:27 -07:00
parent 164ab27d25
commit c0133b8ec7

View file

@ -2,6 +2,7 @@ package goadb
import (
"log"
"reflect"
"testing"
"github.com/stretchr/testify/assert"
@ -165,10 +166,10 @@ func TestCalculateStateDiffsMultipleChangedMultipleUnchanged(t *testing.T) {
diffs := calculateStateDiffs(oldStates, newStates)
assert.Equal(t, []DeviceStateChangedEvent{
assert.True(t, reflect.DeepEqual([]DeviceStateChangedEvent{
DeviceStateChangedEvent{"1", "oldState", "newState"},
DeviceStateChangedEvent{"2", "oldState", "newState"},
}, diffs)
}, diffs))
}
func TestCalculateStateDiffsOneAddedOneRemovedOneChanged(t *testing.T) {
@ -183,11 +184,11 @@ func TestCalculateStateDiffsOneAddedOneRemovedOneChanged(t *testing.T) {
diffs := calculateStateDiffs(oldStates, newStates)
assert.Equal(t, []DeviceStateChangedEvent{
assert.True(t, reflect.DeepEqual([]DeviceStateChangedEvent{
DeviceStateChangedEvent{"1", "oldState", "newState"},
DeviceStateChangedEvent{"2", "removed", ""},
DeviceStateChangedEvent{"3", "", "added"},
}, diffs)
}, diffs))
}
func TestPublishDevicesRestartsServer(t *testing.T) {