|
|
@ -48,6 +48,9 @@ func TestSave(t *testing.T) {
|
|
|
|
Files: []*any.Any{
|
|
|
|
Files: []*any.Any{
|
|
|
|
{TypeUrl: "scheherazade/shahryar.txt", Value: []byte("1,001 Nights")},
|
|
|
|
{TypeUrl: "scheherazade/shahryar.txt", Value: []byte("1,001 Nights")},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
Templates: []*chart.Template{
|
|
|
|
|
|
|
|
{Name: "templates/scheherazade/shahryar.txt.tmpl", Data: []byte("{{ \"1,001 Nights\" }}")},
|
|
|
|
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
where, err := Save(c, tmp)
|
|
|
|
where, err := Save(c, tmp)
|
|
|
@ -75,6 +78,9 @@ func TestSave(t *testing.T) {
|
|
|
|
if len(c2.Files) != 1 || c2.Files[0].TypeUrl != "scheherazade/shahryar.txt" {
|
|
|
|
if len(c2.Files) != 1 || c2.Files[0].TypeUrl != "scheherazade/shahryar.txt" {
|
|
|
|
t.Fatal("Files data did not match")
|
|
|
|
t.Fatal("Files data did not match")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(c2.Templates) != 1 || c2.Templates[0].Name != "templates/scheherazade/shahryar.txt.tmpl" {
|
|
|
|
|
|
|
|
t.Fatal("Templates data did not match")
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func TestSavePreservesTimestamps(t *testing.T) {
|
|
|
|
func TestSavePreservesTimestamps(t *testing.T) {
|
|
|
@ -100,6 +106,9 @@ func TestSavePreservesTimestamps(t *testing.T) {
|
|
|
|
Files: []*any.Any{
|
|
|
|
Files: []*any.Any{
|
|
|
|
{TypeUrl: "scheherazade/shahryar.txt", Value: []byte("1,001 Nights")},
|
|
|
|
{TypeUrl: "scheherazade/shahryar.txt", Value: []byte("1,001 Nights")},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
Templates: []*chart.Template{
|
|
|
|
|
|
|
|
{Name: "templates/scheherazade/shahryar.txt.tmpl", Data: []byte("{{ \"1,001 Nights\" }}")},
|
|
|
|
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
where, err := Save(c, tmp)
|
|
|
|
where, err := Save(c, tmp)
|
|
|
@ -171,6 +180,9 @@ func TestSaveDir(t *testing.T) {
|
|
|
|
Files: []*any.Any{
|
|
|
|
Files: []*any.Any{
|
|
|
|
{TypeUrl: "scheherazade/shahryar.txt", Value: []byte("1,001 Nights")},
|
|
|
|
{TypeUrl: "scheherazade/shahryar.txt", Value: []byte("1,001 Nights")},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
Templates: []*chart.Template{
|
|
|
|
|
|
|
|
{Name: "templates/scheherazade/shahryar.txt.tmpl", Data: []byte("{{ \"1,001 Nights\" }}")},
|
|
|
|
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if err := SaveDir(c, tmp); err != nil {
|
|
|
|
if err := SaveDir(c, tmp); err != nil {
|
|
|
@ -191,4 +203,7 @@ func TestSaveDir(t *testing.T) {
|
|
|
|
if len(c2.Files) != 1 || c2.Files[0].TypeUrl != "scheherazade/shahryar.txt" {
|
|
|
|
if len(c2.Files) != 1 || c2.Files[0].TypeUrl != "scheherazade/shahryar.txt" {
|
|
|
|
t.Fatal("Files data did not match")
|
|
|
|
t.Fatal("Files data did not match")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(c2.Templates) != 1 || c2.Templates[0].Name != "templates/scheherazade/shahryar.txt.tmpl" {
|
|
|
|
|
|
|
|
t.Fatal("Templates data did not match")
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|