(t *testing.T)
| 223 | } |
| 224 | |
| 225 | func TestGetScale(t *testing.T) { |
| 226 | scaleClient, groupResources := fakeScaleClient(t) |
| 227 | expectedScale := &autoscalingv1.Scale{ |
| 228 | TypeMeta: metav1.TypeMeta{ |
| 229 | Kind: "Scale", |
| 230 | APIVersion: autoscalingv1.SchemeGroupVersion.String(), |
| 231 | }, |
| 232 | ObjectMeta: metav1.ObjectMeta{ |
| 233 | Name: "foo", |
| 234 | }, |
| 235 | Spec: autoscalingv1.ScaleSpec{Replicas: 10}, |
| 236 | Status: autoscalingv1.ScaleStatus{ |
| 237 | Replicas: 10, |
| 238 | Selector: "foo=bar", |
| 239 | }, |
| 240 | } |
| 241 | |
| 242 | for _, groupResource := range groupResources { |
| 243 | scale, err := scaleClient.Scales("default").Get(groupResource, "foo") |
| 244 | if !assert.NoError(t, err, "should have been able to fetch a scale for %s", groupResource.String()) { |
| 245 | continue |
| 246 | } |
| 247 | assert.NotNil(t, scale, "should have returned a non-nil scale for %s", groupResource.String()) |
| 248 | |
| 249 | assert.Equal(t, expectedScale, scale, "should have returned the expected scale for %s", groupResource.String()) |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | func TestUpdateScale(t *testing.T) { |
| 254 | scaleClient, groupResources := fakeScaleClient(t) |
nothing calls this directly
no test coverage detected