harness-drone/server/resource/config/model_test.go

40 lines
512 B
Go
Raw Normal View History

2014-06-04 21:25:38 +00:00
package config
import (
"fmt"
"testing"
"github.com/BurntSushi/toml"
)
func TestRead(t *testing.T) {
var data = `
scheme = "https"
host = "localhost"
port = 8080
open = true
[github]
url = "https://github.com"
api = "https://api.github.com"
[bitbucket]
url = "https://bitbucket.org"
[smtp]
host = "smtp.drone.io"
port = "443"
user = "brad"
from = "brad@drone.io"
`
var conf Config
if _, err := toml.Decode(data, &conf); err != nil {
println(err.Error())
return
}
fmt.Printf("%#v\n", conf)
}