mirror of
https://github.com/Oxalide/vsphere-influxdb-go.git
synced 2023-10-10 13:36:51 +02:00
27 lines
504 B
Go
27 lines
504 B
Go
|
package meta_test
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/BurntSushi/toml"
|
||
|
"github.com/influxdata/influxdb/services/meta"
|
||
|
)
|
||
|
|
||
|
func TestConfig_Parse(t *testing.T) {
|
||
|
// Parse configuration.
|
||
|
var c meta.Config
|
||
|
if _, err := toml.Decode(`
|
||
|
dir = "/tmp/foo"
|
||
|
logging-enabled = false
|
||
|
`, &c); err != nil {
|
||
|
t.Fatal(err)
|
||
|
}
|
||
|
|
||
|
// Validate configuration.
|
||
|
if c.Dir != "/tmp/foo" {
|
||
|
t.Fatalf("unexpected dir: %s", c.Dir)
|
||
|
} else if c.LoggingEnabled {
|
||
|
t.Fatalf("unexpected logging enabled: %v", c.LoggingEnabled)
|
||
|
}
|
||
|
}
|