errUnableToRead:=errors.New("unable to read config file: ")
tests:=map[string]struct {
pathstring
want config.Stack
errerror
}{
"error": {
path: "sadasd",
want: config.Stack{},
err: errUnableToRead,
},
"no_custom": {
path: "testdata/dsfolders/no_customs",
want: config.Stack{
Config: config.Config{
Title: "TESTCONFIG",
Name: "test",
Description: "A test string for usage with this stuff.",
Duration: 5,
Project: true,
Region: true,
RegionType: "functions",
RegionDefault: "us-central1",
},
},
err: nil,
},
"no_name": {
path: "testdata/dsfolders/no_name",
want: config.Stack{
Config: config.Config{
Title: "NONAME",
Name: "",
Description: "A test string for usage with this stuff.",
Duration: 5,
Project: true,
Region: true,
RegionType: "functions",
RegionDefault: "us-central1",
},
},
err: fmt.Errorf("could retrieve name of stack: could not open local git directory: repository does not exist \nDeployStack author: fix this by adding a 'name' key and value to the deploystack config"),
},
"custom": {
path: "testdata/dsfolders/customs",
want: config.Stack{
Config: config.Config{
Title: "TESTCONFIG",
Name: "test",
Description: "A test string for usage with this stuff.",