| 27 | ) |
| 28 | |
| 29 | func 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 | |
| 67 | func TestCreateFrom(t *testing.T) { |
| 68 | tdir := t.TempDir() |