fix(tiller): add tests

pull/613/head
Matt Butcher 9 years ago
parent dcfd1a4284
commit 00aaf653da

@ -73,7 +73,7 @@ func (s *releaseServer) InstallRelease(c ctx.Context, req *services.InstallRelea
return nil, err
}
return &services.InstallReleaseResponse{Release: r}, errNotImplemented
return &services.InstallReleaseResponse{Release: r}, nil
}
func (s *releaseServer) UninstallRelease(c ctx.Context, req *services.UninstallReleaseRequest) (*services.UninstallReleaseResponse, error) {

@ -0,0 +1,38 @@
package main
import (
"github.com/deis/tiller/cmd/tiller/environment"
"github.com/deis/tiller/pkg/proto/hapi/chart"
"github.com/deis/tiller/pkg/proto/hapi/services"
"github.com/deis/tiller/pkg/storage"
"golang.org/x/net/context"
"testing"
)
func rsFixture() *releaseServer {
return &releaseServer{
env: mockEnvironment(),
}
}
func TestInstallRelease(t *testing.T) {
c := context.Background()
rs := rsFixture()
req := &services.InstallReleaseRequest{
Chart: &chart.Chart{},
}
res, err := rs.InstallRelease(c, req)
if err != nil {
t.Errorf("Failed install: %s", err)
}
if res.Release.Name == "" {
t.Errorf("Expected release name.")
}
}
func mockEnvironment() *environment.Environment {
e := environment.New()
e.Releases = storage.NewMemory()
return e
}
Loading…
Cancel
Save