forked from hishamkaram/geoserver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
geoserver_test.go
31 lines (28 loc) · 859 Bytes
/
geoserver_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package geoserver
import (
"bytes"
"path/filepath"
"testing"
"github.com/stretchr/testify/assert"
)
func TestLoadConfig(t *testing.T) {
var gsCatalog GeoServer
file, _ := filepath.Abs("../geoserver/testdata/config.yml")
geoserver, err := gsCatalog.LoadConfig(file)
assert.NotNil(t, geoserver)
assert.Nil(t, err)
//test if can't find yaml
file, _ = filepath.Abs("")
geoserver, err = gsCatalog.LoadConfig(file)
assert.Nil(t, geoserver)
assert.NotNil(t, err)
file, _ = filepath.Abs("../geoserver/testdata/config.err.yml")
geoserver, err = gsCatalog.LoadConfig(file)
assert.Nil(t, geoserver)
assert.NotNil(t, err)
}
func TestGetGeoserverRequest(t *testing.T) {
gsCatalog := GetCatalog("", "", "")
request := gsCatalog.GetGeoserverRequest("", getMethod, jsonType, bytes.NewBuffer(make([]byte, 0, 0)), jsonType)
assert.NotNil(t, request)
}