(t *testing.T)
| 251 | } |
| 252 | |
| 253 | func TestUpdateScale(t *testing.T) { |
| 254 | scaleClient, groupResources := fakeScaleClient(t) |
| 255 | expectedScale := &autoscalingv1.Scale{ |
| 256 | TypeMeta: metav1.TypeMeta{ |
| 257 | Kind: "Scale", |
| 258 | APIVersion: autoscalingv1.SchemeGroupVersion.String(), |
| 259 | }, |
| 260 | ObjectMeta: metav1.ObjectMeta{ |
| 261 | Name: "foo", |
| 262 | }, |
| 263 | Spec: autoscalingv1.ScaleSpec{Replicas: 10}, |
| 264 | Status: autoscalingv1.ScaleStatus{ |
| 265 | Replicas: 10, |
| 266 | Selector: "foo=bar", |
| 267 | }, |
| 268 | } |
| 269 | |
| 270 | for _, groupResource := range groupResources { |
| 271 | scale, err := scaleClient.Scales("default").Update(groupResource, expectedScale) |
| 272 | if !assert.NoError(t, err, "should have been able to fetch a scale for %s", groupResource.String()) { |
| 273 | continue |
| 274 | } |
| 275 | assert.NotNil(t, scale, "should have returned a non-nil scale for %s", groupResource.String()) |
| 276 | |
| 277 | assert.Equal(t, expectedScale, scale, "should have returned the expected scale for %s", groupResource.String()) |
| 278 | } |
| 279 | } |
nothing calls this directly
no test coverage detected