forked from go-spatial/tegola
-
Notifications
You must be signed in to change notification settings - Fork 0
/
provider_test.go
37 lines (34 loc) · 949 Bytes
/
provider_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
32
33
34
35
36
37
package provider_test
import (
"testing"
"github.com/go-spatial/tegola/provider"
"github.com/go-spatial/tegola/provider/test"
)
func TestProviderInterface(t *testing.T) {
var (
stdName = provider.TypeStd.Prefix() + test.Name
mvtName = provider.TypeMvt.Prefix() + test.Name
)
if _, err := provider.For(stdName, nil); err != nil {
t.Errorf("retrieve provider err , expected nil got %v", err)
return
}
if test.Count != 1 {
t.Errorf(" expected count , expected 1 got %v", test.Count)
}
provider.Cleanup()
if test.Count != 0 {
t.Errorf(" expected count , expected 0 got %v", test.Count)
}
if _, err := provider.For(mvtName, nil); err != nil {
t.Errorf("retrieve provider err , expected nil got %v", err)
return
}
if test.MVTCount != 1 {
t.Errorf(" expected count , expected 1 got %v", test.MVTCount)
}
provider.Cleanup()
if test.MVTCount != 0 {
t.Errorf(" expected count , expected 0 got %v", test.MVTCount)
}
}