MCPcopy
hub / github.com/helm/helm / TestCreate

Function TestCreate

pkg/chart/v2/util/create_test.go:29–65  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

27)
28
29func TestCreate(t *testing.T) {
30 tdir := t.TempDir()
31
32 c, err := Create("foo", tdir)
33 if err != nil {
34 t.Fatal(err)
35 }
36
37 dir := filepath.Join(tdir, "foo")
38
39 mychart, err := loader.LoadDir(c)
40 if err != nil {
41 t.Fatalf("Failed to load newly created chart %q: %s", c, err)
42 }
43
44 if mychart.Name() != "foo" {
45 t.Errorf("Expected name to be 'foo', got %q", mychart.Name())
46 }
47
48 for _, f := range []string{
49 ChartfileName,
50 DeploymentName,
51 HelpersName,
52 IgnorefileName,
53 NotesName,
54 ServiceAccountName,
55 ServiceName,
56 TemplatesDir,
57 TemplatesTestsDir,
58 TestConnectionName,
59 ValuesfileName,
60 } {
61 if _, err := os.Stat(filepath.Join(dir, f)); err != nil {
62 t.Errorf("Expected %s file: %s", f, err)
63 }
64 }
65}
66
67func TestCreateFrom(t *testing.T) {
68 tdir := t.TempDir()

Callers

nothing calls this directly

Calls 5

LoadDirFunction · 0.92
FatalMethod · 0.80
FatalfMethod · 0.80
CreateFunction · 0.70
NameMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…