(t *testing.T)
| 400 | } |
| 401 | |
| 402 | func TestReplicaSetScale(t *testing.T) { |
| 403 | scaleClientExpectedAction := []string{"patch"} |
| 404 | scaleClient := createFakeScaleClient("replicasets", "foo", 10, nil) |
| 405 | scaler := NewScaler(scaleClient) |
| 406 | count := uint(3) |
| 407 | name := "foo" |
| 408 | actualSize := new(int32) |
| 409 | err := scaler.Scale("default", name, count, actualSize, nil, nil, nil, rsgvr, false) |
| 410 | if err != nil { |
| 411 | t.Fatal(err) |
| 412 | } |
| 413 | if *actualSize != 3 { |
| 414 | t.Errorf("expected actualSize to be 3, got %d", *actualSize) |
| 415 | } |
| 416 | actions := scaleClient.Actions() |
| 417 | if len(actions) != len(scaleClientExpectedAction) { |
| 418 | t.Errorf("unexpected actions: %v, expected %d actions got %d", actions, len(scaleClientExpectedAction), len(actions)) |
| 419 | } |
| 420 | for i, verb := range scaleClientExpectedAction { |
| 421 | if actions[i].GetVerb() != verb { |
| 422 | t.Errorf("unexpected action: %+v, expected %s", actions[i].GetVerb(), verb) |
| 423 | } |
| 424 | } |
| 425 | } |
| 426 | |
| 427 | func TestReplicaSetScaleRetry(t *testing.T) { |
| 428 | verbsOnError := map[string]*apierrors.StatusError{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…