@@ -12,6 +12,7 @@ import (
12
12
"testing"
13
13
14
14
"github.com/CrunchyData/pg_featureserv/internal/api"
15
+ "github.com/CrunchyData/pg_featureserv/internal/conf"
15
16
"github.com/CrunchyData/pg_featureserv/internal/data"
16
17
"github.com/CrunchyData/pg_featureserv/internal/service"
17
18
"github.com/CrunchyData/pg_featureserv/util"
@@ -33,6 +34,8 @@ type geojsonFeatureData struct {
33
34
}
34
35
35
36
func TestMain (m * testing.M ) {
37
+ conf .Configuration .Database .AllowWrite = true
38
+
36
39
db = util .CreateTestDb ()
37
40
defer util .CloseTestDb (db )
38
41
@@ -50,23 +53,6 @@ func TestProperDbInit(t *testing.T) {
50
53
util .Equals (t , 2 , len (tables ), "# table in DB" )
51
54
}
52
55
53
- func TestTestPropertiesAllFromDb (t * testing.T ) {
54
- /*rr := hTest.DoRequest(t, "/collections/mock_a/items?limit=2")
55
-
56
- var v FeatureCollection
57
- errUnMarsh := json.Unmarshal(hTest.ReadBody(rr), &v)
58
- util.Assert(t, errUnMarsh == nil, fmt.Sprintf("%v", errUnMarsh))
59
-
60
- // Note that JSON numbers are read as float64
61
- util.Equals(t, 2, len(v.Features), "# features")
62
- util.Equals(t, 4, len(v.Features[0].Props), "feature 1 # properties")
63
-
64
- util.Equals(t, "propA", v.Features[0].Props["prop_a"], "feature 1 # property A")
65
- util.Equals(t, 1.0, v.Features[0].Props["prop_b"], "feature 1 # property B")
66
- util.Equals(t, "propC", v.Features[0].Props["prop_c"], "feature 1 # property C")
67
- util.Equals(t, 1.0, v.Features[0].Props["prop_d"], "feature 1 # property D")*/
68
- }
69
-
70
56
func TestCreateFeatureWithBadGeojsonInputDb (t * testing.T ) {
71
57
var header = make (http.Header )
72
58
header .Add ("Content-Type" , "application/geo+json" )
0 commit comments