@ -164,9 +164,21 @@ func TestUpdate(t *testing.T) {
t . Fatal ( err )
}
if _ , err := c . Update ( first , second , false ) ; err != nil {
result , err := c . Update ( first , second , false )
if err != nil {
t . Fatal ( err )
}
if len ( result . Created ) != 1 {
t . Errorf ( "expected 1 resource created, got %d" , len ( result . Created ) )
}
if len ( result . Updated ) != 2 {
t . Errorf ( "expected 2 resource updated, got %d" , len ( result . Updated ) )
}
if len ( result . Deleted ) != 1 {
t . Errorf ( "expected 1 resource deleted, got %d" , len ( result . Deleted ) )
}
// TODO: Find a way to test methods that use Client Set
// Test with a wait
// if err := c.Update("test", objBody(codec, &listB), objBody(codec, &listC), false, 300, true); err != nil {
@ -190,8 +202,7 @@ func TestUpdate(t *testing.T) {
"/namespaces/default/pods/squid:DELETE" ,
}
if len ( expectedActions ) != len ( actions ) {
t . Errorf ( "unexpected number of requests, expected %d, got %d" , len ( expectedActions ) , len ( actions ) )
return
t . Fatalf ( "unexpected number of requests, expected %d, got %d" , len ( expectedActions ) , len ( actions ) )
}
for k , v := range expectedActions {
if actions [ k ] != v {