Refactor tests to split ObjectMeta from TypeMeta

This commit is contained in:
Clayton Coleman
2014-10-23 16:51:34 -04:00
parent 7550c146dc
commit 644eb70085
55 changed files with 739 additions and 633 deletions

View File

@@ -27,7 +27,7 @@ import (
)
func TestServices(t *testing.T) {
service := api.Service{TypeMeta: api.TypeMeta{Name: "bar", ResourceVersion: "2"}}
service := api.Service{ObjectMeta: api.ObjectMeta{Name: "bar", ResourceVersion: "2"}}
fakeWatch := watch.NewFake()
fakeClient := &client.Fake{Watch: fakeWatch}
@@ -72,13 +72,13 @@ func TestServices(t *testing.T) {
}
func TestServicesFromZero(t *testing.T) {
service := api.Service{TypeMeta: api.TypeMeta{Name: "bar", ResourceVersion: "2"}}
service := api.Service{ObjectMeta: api.ObjectMeta{Name: "bar", ResourceVersion: "2"}}
fakeWatch := watch.NewFake()
fakeWatch.Stop()
fakeClient := &client.Fake{Watch: fakeWatch}
fakeClient.ServiceList = api.ServiceList{
TypeMeta: api.TypeMeta{ResourceVersion: "2"},
ListMeta: api.ListMeta{ResourceVersion: "2"},
Items: []api.Service{
service,
},
@@ -152,7 +152,7 @@ func TestServicesFromZeroError(t *testing.T) {
}
func TestEndpoints(t *testing.T) {
endpoint := api.Endpoints{TypeMeta: api.TypeMeta{Name: "bar", ResourceVersion: "2"}, Endpoints: []string{"127.0.0.1:9000"}}
endpoint := api.Endpoints{ObjectMeta: api.ObjectMeta{Name: "bar", ResourceVersion: "2"}, Endpoints: []string{"127.0.0.1:9000"}}
fakeWatch := watch.NewFake()
fakeClient := &client.Fake{Watch: fakeWatch}
@@ -197,13 +197,13 @@ func TestEndpoints(t *testing.T) {
}
func TestEndpointsFromZero(t *testing.T) {
endpoint := api.Endpoints{TypeMeta: api.TypeMeta{Name: "bar", ResourceVersion: "2"}, Endpoints: []string{"127.0.0.1:9000"}}
endpoint := api.Endpoints{ObjectMeta: api.ObjectMeta{Name: "bar", ResourceVersion: "2"}, Endpoints: []string{"127.0.0.1:9000"}}
fakeWatch := watch.NewFake()
fakeWatch.Stop()
fakeClient := &client.Fake{Watch: fakeWatch}
fakeClient.EndpointsList = api.EndpointsList{
TypeMeta: api.TypeMeta{ResourceVersion: "2"},
ListMeta: api.ListMeta{ResourceVersion: "2"},
Items: []api.Endpoints{
endpoint,
},