mirror of https://github.com/helm/helm
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
784 B
39 lines
784 B
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
|
|
}
|