Update vendor files to point to kubernetes-1.12.0-beta.1
This commit is contained in:
38
vendor/k8s.io/apimachinery/pkg/watch/watch_test.go
generated
vendored
38
vendor/k8s.io/apimachinery/pkg/watch/watch_test.go
generated
vendored
@@ -17,6 +17,7 @@ limitations under the License.
|
||||
package watch_test
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
@@ -135,3 +136,40 @@ func TestEmpty(t *testing.T) {
|
||||
t.Errorf("unexpected result channel result")
|
||||
}
|
||||
}
|
||||
|
||||
func TestProxyWatcher(t *testing.T) {
|
||||
events := []Event{
|
||||
{Added, testType("foo")},
|
||||
{Modified, testType("qux")},
|
||||
{Modified, testType("bar")},
|
||||
{Deleted, testType("bar")},
|
||||
{Error, testType("error: blah")},
|
||||
}
|
||||
|
||||
ch := make(chan Event, len(events))
|
||||
w := NewProxyWatcher(ch)
|
||||
|
||||
for _, e := range events {
|
||||
ch <- e
|
||||
}
|
||||
|
||||
for _, e := range events {
|
||||
g := <-w.ResultChan()
|
||||
if !reflect.DeepEqual(e, g) {
|
||||
t.Errorf("Expected %#v, got %#v", e, g)
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
w.Stop()
|
||||
|
||||
select {
|
||||
// Closed channel always reads immediately
|
||||
case <-w.StopChan():
|
||||
default:
|
||||
t.Error("Channel isn't closed")
|
||||
}
|
||||
|
||||
// Test double close
|
||||
w.Stop()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user