Open benoitdm-oslandia opened 1 year ago
In GitLab by @nrevelant on Oct 20, 2022, 10:15
formats autres que JSON et srid différents de 4326
Example de test à prévoir dés qu'un autre format sera implémenté ( handler_db_etag_test.go ):
Remarque: Avec pg_featureserv, le client peut réclamer un format spécifique:
func (t *DbTests) TestWeakEtagFromDifferentRepresentationsDb() { t.Test.Run("TestWeakEtagFromDifferentRepresentationsDb", func(t *testing.T) { cache := data.CachePassive{} path := "/collections/mock_b/items/1" var headerJson = make(http.Header) headerJson.Add("Accept", api.ContentTypeJSON) // JSON representation resp := hTest.DoRequestMethodStatus(t, "GET", path, []byte(""), headerJson, http.StatusOK) strongEtagJson := resp.Header().Get("Etag") weakEtag1, err := cache.GetWeakEtagFromStrongEtag(strongEtagJson) util.Assert(t, err == nil, "wrong strong etag form") // GML representation var headerGml = make(http.Header) // TODO // headerGml.Add("Accept", api.ContentTypeGML) path2 := "/collections/mock_b/items/1" resp2 := hTest.DoRequestMethodStatus(t, "GET", path2, []byte(""), headerGml, http.StatusOK) strongEtagGml := resp2.Header().Get("Etag") weakEtag2, err := cache.GetWeakEtagFromStrongEtag(strongEtagGml) util.Assert(t, err == nil, "wrong strong etag form") // TODO -> need implementation for other formats than JSON // util.Assert(t, strongEtagJson != strongEtagGml, "same strong etags for different representations !") util.Assert(t, weakEtag1 == weakEtag2, "weak etag values are different for the same feature!") // TODO path3 := "/collections/mock_b/items/1.html" // TODO path4 := "/collections/mock_b/items/1.json" // ... }) }
marked this issue as related to #10
In GitLab by @nrevelant on Oct 20, 2022, 10:15
formats autres que JSON et srid différents de 4326
Example de test à prévoir dés qu'un autre format sera implémenté ( handler_db_etag_test.go ):
Remarque: Avec pg_featureserv, le client peut réclamer un format spécifique: