Skip to content
Snippets Groups Projects
Commit f172e50c authored by Niall Sheridan's avatar Niall Sheridan Committed by GitHub
Browse files

Merge branch 'master' into no-datastore

parents a356aab1 4993eae2
Branches no-datastore
No related tags found
No related merge requests found
...@@ -58,30 +58,3 @@ func TestConfigVerify(t *testing.T) { ...@@ -58,30 +58,3 @@ func TestConfigVerify(t *testing.T) {
_, err := ReadConfig("testdata/empty.config") _, err := ReadConfig("testdata/empty.config")
assert.Contains(t, err.Error(), "missing ssh config section", "missing server config section", "missing auth config section") assert.Contains(t, err.Error(), "missing ssh config section", "missing server config section", "missing auth config section")
} }
func TestDatastoreConversion(t *testing.T) {
tests := []struct {
in string
out Database
}{
{
"mysql:user:passwd:localhost:3306", Database{"type": "mysql", "username": "user", "password": "passwd", "address": "localhost:3306"},
},
{
"mem", Database{"type": "mem"},
},
{
"sqlite:/data/certs.db", Database{"type": "sqlite", "filename": "/data/certs.db"},
},
}
for _, tc := range tests {
config := &Config{
Server: &Server{
Datastore: tc.in,
},
}
convertDatastoreConfig(config)
assert.EqualValues(t, config.Server.Database, tc.out)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment