graphql-engine/cli/util/install_manifest_test.go
2018-06-27 17:34:09 +05:30

36 lines
717 B
Go

package util
import (
"os"
"testing"
)
var i = &InstallManifestsRepo{
Namespace: "hasura",
Name: "graphql-engine-install-manifests",
}
func TestZipURL(t *testing.T) {
expected := "https://github.com/hasura/graphql-engine-install-manifests/archive/master.zip"
u := i.ZipURL()
if u != expected {
t.Fatalf("expected: %s, got %s", expected, u)
}
}
func TestZipExtractedDirectory(t *testing.T) {
expected := "graphql-engine-install-manifests-master"
got := i.ZipExtractedDirectory()
if got != expected {
t.Fatalf("expected: %s, got %s", expected, got)
}
}
func TestDownload(t *testing.T) {
dir, err := i.Download()
if err != nil {
t.Fatalf("download failed: %v", err)
}
os.RemoveAll(dir)
}