mirror of https://github.com/helm/helm
Merge pull request #32 from technosophos/feat/helm-install
feat(tiller): add template and release to installpull/613/head
commit
77322a5f06
@ -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…
Reference in new issue