(t *testing.T)
| 182 | } |
| 183 | |
| 184 | func TestGetObjectSubresourceStatus(t *testing.T) { |
| 185 | _, _, replicationcontrollers := cmdtesting.TestData() |
| 186 | |
| 187 | tf := cmdtesting.NewTestFactory().WithNamespace("test") |
| 188 | defer tf.Cleanup() |
| 189 | codec := scheme.Codecs.LegacyCodec(scheme.Scheme.PrioritizedVersionsAllGroups()...) |
| 190 | |
| 191 | tf.UnstructuredClient = &fake.RESTClient{ |
| 192 | NegotiatedSerializer: resource.UnstructuredPlusDefaultContentConfig().NegotiatedSerializer, |
| 193 | Resp: &http.Response{StatusCode: http.StatusOK, Header: cmdtesting.DefaultHeader(), Body: cmdtesting.ObjBody(codec, &replicationcontrollers.Items[0])}, |
| 194 | } |
| 195 | |
| 196 | streams, _, buf, _ := genericiooptions.NewTestIOStreams() |
| 197 | cmd := NewCmdGet("kubectl", tf, streams) |
| 198 | cmd.SetOut(buf) |
| 199 | cmd.SetErr(buf) |
| 200 | cmd.Flags().Set("subresource", "status") |
| 201 | cmd.Run(cmd, []string{"replicationcontrollers", "rc1"}) |
| 202 | |
| 203 | expected := `NAME AGE |
| 204 | rc1 <unknown> |
| 205 | ` |
| 206 | |
| 207 | if e, a := expected, buf.String(); e != a { |
| 208 | t.Errorf("expected\n%v\ngot\n%v", e, a) |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | func TestGetObjectSubresourceScale(t *testing.T) { |
| 213 | _, _, replicationcontrollers := cmdtesting.TestData() |
nothing calls this directly
no test coverage detected
searching dependent graphs…