Improve pkg/registry/service code coverage.

This commit is contained in:
Deyuan Deng
2014-08-18 23:18:00 -04:00
parent 9bafb8c541
commit c104551025
2 changed files with 89 additions and 7 deletions

View File

@@ -32,6 +32,7 @@ type ServiceRegistry struct {
DeletedID string
GottenID string
UpdatedID string
}
func (r *ServiceRegistry) ListServices() (api.ServiceList, error) {
@@ -40,6 +41,7 @@ func (r *ServiceRegistry) ListServices() (api.ServiceList, error) {
func (r *ServiceRegistry) CreateService(svc api.Service) error {
r.Service = &svc
r.List.Items = append(r.List.Items, svc)
return r.Err
}
@@ -54,6 +56,7 @@ func (r *ServiceRegistry) DeleteService(id string) error {
}
func (r *ServiceRegistry) UpdateService(svc api.Service) error {
r.UpdatedID = svc.ID
return r.Err
}