realize/server/open_test.go

29 lines
458 B
Go
Raw Normal View History

2017-08-14 20:17:11 +00:00
package server
import (
"testing"
//"fmt"
"fmt"
"github.com/tockins/realize/settings"
)
func TestOpen(t *testing.T) {
config := settings.Settings{
Server: settings.Server{
Open: true,
},
}
s := Server{
Settings: &config,
}
url := "open_test"
out, err := s.OpenURL(url)
if err == nil {
t.Fatal("Unexpected, invalid url", url, err)
}
output := fmt.Sprint(out)
if output == "" {
t.Fatal("Unexpected, invalid url", url, output)
}
}