|
|
@ -270,3 +270,25 @@ func TestLoadUnversionedIndex(t *testing.T) {
|
|
|
|
t.Fatalf("Expected 3 mysql versions, got %d", l)
|
|
|
|
t.Fatalf("Expected 3 mysql versions, got %d", l)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func TestIndexAdd(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
i := NewIndexFile()
|
|
|
|
|
|
|
|
i.Add(&chart.Metadata{Name: "clipper", Version: "0.1.0"}, "clipper-0.1.0.tgz", "http://example.com/charts", "sha256:1234567890")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if i.Entries["clipper"][0].URLs[0] != "http://example.com/charts/clipper-0.1.0.tgz" {
|
|
|
|
|
|
|
|
t.Errorf("Expected http://example.com/charts/clipper-0.1.0.tgz, got %s", i.Entries["clipper"][0].URLs[0])
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
i.Add(&chart.Metadata{Name: "alpine", Version: "0.1.0"}, "/home/charts/alpine-0.1.0.tgz", "http://example.com/charts", "sha256:1234567890")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if i.Entries["alpine"][0].URLs[0] != "http://example.com/charts/alpine-0.1.0.tgz" {
|
|
|
|
|
|
|
|
t.Errorf("Expected http://example.com/charts/alpine-0.1.0.tgz, got %s", i.Entries["alpine"][0].URLs[0])
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
i.Add(&chart.Metadata{Name: "deis", Version: "0.1.0"}, "/home/charts/deis-0.1.0.tgz", "http://example.com/charts/", "sha256:1234567890")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if i.Entries["deis"][0].URLs[0] != "http://example.com/charts/deis-0.1.0.tgz" {
|
|
|
|
|
|
|
|
t.Errorf("Expected http://example.com/charts/deis-0.1.0.tgz, got %s", i.Entries["deis"][0].URLs[0])
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|