add a unit test

This commit is contained in:
ymqytw
2016-11-18 15:00:14 -08:00
parent 48d3ca23cf
commit 11653b11c1
5 changed files with 131 additions and 11 deletions

View File

@@ -427,8 +427,12 @@ func (f *fakeAPIFactory) UnstructuredObject() (meta.RESTMapper, runtime.ObjectTy
return cmdutil.NewShortcutExpander(mapper, nil), typer, nil
}
func (f *fakeAPIFactory) Decoder(bool) runtime.Decoder {
return testapi.Default.Codec()
func (f *fakeAPIFactory) Decoder(toInternal bool) runtime.Decoder {
if toInternal {
return api.Codecs.UniversalDecoder()
} else {
return api.Codecs.UniversalDeserializer()
}
}
func (f *fakeAPIFactory) JSONEncoder() runtime.Encoder {