From e53fcbc9d75b682bf7b7c46a8e6df6158b59dfa3 Mon Sep 17 00:00:00 2001 From: Patrick Mezard Date: Thu, 18 Aug 2016 09:03:04 +0200 Subject: [PATCH 1/3] test/ciao: update valid layers list in reference output --- test/ciao/autocomplete/layers_invalid.coffee | 2 +- test/ciao/autocomplete/layers_mix_invalid_valid.coffee | 2 +- test/ciao/reverse/layers_invalid.coffee | 2 +- test/ciao/reverse/layers_mix_invalid_valid.coffee | 2 +- test/ciao/search/layers_invalid.coffee | 2 +- test/ciao/search/layers_mix_invalid_valid.coffee | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/ciao/autocomplete/layers_invalid.coffee b/test/ciao/autocomplete/layers_invalid.coffee index 6f3cebe0..5e5431db 100644 --- a/test/ciao/autocomplete/layers_invalid.coffee +++ b/test/ciao/autocomplete/layers_invalid.coffee @@ -24,7 +24,7 @@ json.features.should.be.instanceof Array #? expected errors should.exist json.geocoding.errors -json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,region,county,locality,continent,dependency,macroregion,localadmin,macrocounty,macrohood,borough,neighbourhood,microhood,disputed' ] +json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,macroregion,region,county,localadmin,locality,borough,neighbourhood,continent,dependency,macrocounty,macrohood,microhood,disputed' ] #? expected warnings should.not.exist json.geocoding.warnings diff --git a/test/ciao/autocomplete/layers_mix_invalid_valid.coffee b/test/ciao/autocomplete/layers_mix_invalid_valid.coffee index a819dd44..a256e988 100644 --- a/test/ciao/autocomplete/layers_mix_invalid_valid.coffee +++ b/test/ciao/autocomplete/layers_mix_invalid_valid.coffee @@ -24,7 +24,7 @@ json.features.should.be.instanceof Array #? expected errors should.exist json.geocoding.errors -json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,region,county,locality,continent,dependency,macroregion,localadmin,macrocounty,macrohood,borough,neighbourhood,microhood,disputed' ] +json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,macroregion,region,county,localadmin,locality,borough,neighbourhood,continent,dependency,macrocounty,macrohood,microhood,disputed' ] #? expected warnings should.not.exist json.geocoding.warnings diff --git a/test/ciao/reverse/layers_invalid.coffee b/test/ciao/reverse/layers_invalid.coffee index bc57a3b3..f9e115f1 100644 --- a/test/ciao/reverse/layers_invalid.coffee +++ b/test/ciao/reverse/layers_invalid.coffee @@ -24,7 +24,7 @@ json.features.should.be.instanceof Array #? expected errors should.exist json.geocoding.errors -json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,region,county,locality,continent,dependency,macroregion,localadmin,macrocounty,macrohood,borough,neighbourhood,microhood,disputed' ] +json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,macroregion,region,county,localadmin,locality,borough,neighbourhood,continent,dependency,macrocounty,macrohood,microhood,disputed' ] #? expected warnings should.not.exist json.geocoding.warnings diff --git a/test/ciao/reverse/layers_mix_invalid_valid.coffee b/test/ciao/reverse/layers_mix_invalid_valid.coffee index 16f40b9e..6ef5b01b 100644 --- a/test/ciao/reverse/layers_mix_invalid_valid.coffee +++ b/test/ciao/reverse/layers_mix_invalid_valid.coffee @@ -24,7 +24,7 @@ json.features.should.be.instanceof Array #? expected errors should.exist json.geocoding.errors -json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,region,county,locality,continent,dependency,macroregion,localadmin,macrocounty,macrohood,borough,neighbourhood,microhood,disputed' ] +json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,macroregion,region,county,localadmin,locality,borough,neighbourhood,continent,dependency,macrocounty,macrohood,microhood,disputed' ] #? expected warnings should.not.exist json.geocoding.warnings diff --git a/test/ciao/search/layers_invalid.coffee b/test/ciao/search/layers_invalid.coffee index cc6feab8..dd8a72c7 100644 --- a/test/ciao/search/layers_invalid.coffee +++ b/test/ciao/search/layers_invalid.coffee @@ -24,7 +24,7 @@ json.features.should.be.instanceof Array #? expected errors should.exist json.geocoding.errors -json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,region,county,locality,continent,dependency,macroregion,localadmin,macrocounty,macrohood,borough,neighbourhood,microhood,disputed' ] +json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,macroregion,region,county,localadmin,locality,borough,neighbourhood,continent,dependency,macrocounty,macrohood,microhood,disputed' ] #? expected warnings should.not.exist json.geocoding.warnings diff --git a/test/ciao/search/layers_mix_invalid_valid.coffee b/test/ciao/search/layers_mix_invalid_valid.coffee index f332e051..06b5a4ee 100644 --- a/test/ciao/search/layers_mix_invalid_valid.coffee +++ b/test/ciao/search/layers_mix_invalid_valid.coffee @@ -24,7 +24,7 @@ json.features.should.be.instanceof Array #? expected errors should.exist json.geocoding.errors -json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,region,county,locality,continent,dependency,macroregion,localadmin,macrocounty,macrohood,borough,neighbourhood,microhood,disputed' ] +json.geocoding.errors.should.eql [ '\'notlayer\' is an invalid layers parameter. Valid options: coarse,address,venue,country,macroregion,region,county,localadmin,locality,borough,neighbourhood,continent,dependency,macrocounty,macrohood,microhood,disputed' ] #? expected warnings should.not.exist json.geocoding.warnings From 0f0cfd16d9bee0ac6b93abaa3e54664f1f48ea9c Mon Sep 17 00:00:00 2001 From: Patrick Mezard Date: Mon, 22 Aug 2016 21:52:54 +0200 Subject: [PATCH 2/3] test/ciao: fix inverted negative latitudes in tests See https://github.com/elastic/elasticsearch/issues/18458 --- test/ciao/search/boundary_rect_valid.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/ciao/search/boundary_rect_valid.coffee b/test/ciao/search/boundary_rect_valid.coffee index efb2cc4a..0d7b90fa 100644 --- a/test/ciao/search/boundary_rect_valid.coffee +++ b/test/ciao/search/boundary_rect_valid.coffee @@ -1,6 +1,6 @@ #> bounding rectangle -path: '/v1/search?text=a&boundary.rect.min_lat=-40.659&boundary.rect.max_lat=-41.614&boundary.rect.min_lon=174.612&boundary.rect.max_lon=176.333' +path: '/v1/search?text=a&boundary.rect.max_lat=-40.659&boundary.rect.min_lat=-41.614&boundary.rect.min_lon=174.612&boundary.rect.max_lon=176.333' #? 200 ok response.statusCode.should.be.equal 200 @@ -31,7 +31,7 @@ should.not.exist json.geocoding.warnings #? inputs json.geocoding.query['text'].should.eql 'a' json.geocoding.query['size'].should.eql 10 -json.geocoding.query['boundary.rect.min_lat'].should.eql -40.659 -json.geocoding.query['boundary.rect.max_lat'].should.eql -41.614 +json.geocoding.query['boundary.rect.min_lat'].should.eql -41.614 +json.geocoding.query['boundary.rect.max_lat'].should.eql -40.659 json.geocoding.query['boundary.rect.min_lon'].should.eql 174.612 -json.geocoding.query['boundary.rect.max_lon'].should.eql 176.333 \ No newline at end of file +json.geocoding.query['boundary.rect.max_lon'].should.eql 176.333 From 50475c616b0e6442e02e8fc9ec7715be8d1de616 Mon Sep 17 00:00:00 2001 From: Patrick Mezard Date: Mon, 22 Aug 2016 22:31:09 +0200 Subject: [PATCH 3/3] test/ciao: reverse learnt to handle circle at some point So fix the test pretending it does not. --- .../boundary_circle_invalid_radius.coffee | 14 +++++--------- .../reverse/boundary_circle_valid_radius.coffee | 16 ++++++---------- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/test/ciao/reverse/boundary_circle_invalid_radius.coffee b/test/ciao/reverse/boundary_circle_invalid_radius.coffee index cb257d4e..cc47292a 100644 --- a/test/ciao/reverse/boundary_circle_invalid_radius.coffee +++ b/test/ciao/reverse/boundary_circle_invalid_radius.coffee @@ -26,14 +26,10 @@ json.features.should.be.instanceof Array should.exist json.geocoding.errors json.geocoding.errors.should.eql [ 'missing param \'boundary.circle.radius\'' ] -#? expected warnings -should.exist json.geocoding.warnings -json.geocoding.warnings.should.eql [ 'boundary.circle is currently unsupported' ] - #? inputs # json.geocoding.query['size'].should.eql 10 -# json.geocoding.query['point.lat'].should.eql 40.744243 -# json.geocoding.query['point.lon'].should.eql -73.990342 -# json.geocoding.query['boundary.circle.lat'].should.eql 40.744243 -# json.geocoding.query['boundary.circle.lon'].should.eql -73.990342 -# should.not.exist json.geocoding.query['boundary.circle.radius'] +json.geocoding.query['point.lat'].should.eql 40.744243 +json.geocoding.query['point.lon'].should.eql -73.990342 +should.not.exist json.geocoding.query['boundary.circle.radius'] +should.not.exist json.geocoding.query['boundary.circle.lat'] +should.not.exist json.geocoding.query['boundary.circle.lon'] diff --git a/test/ciao/reverse/boundary_circle_valid_radius.coffee b/test/ciao/reverse/boundary_circle_valid_radius.coffee index 9279eb70..f4ef8f35 100644 --- a/test/ciao/reverse/boundary_circle_valid_radius.coffee +++ b/test/ciao/reverse/boundary_circle_valid_radius.coffee @@ -25,14 +25,10 @@ json.features.should.be.instanceof Array #? expected errors should.not.exist json.geocoding.errors -#? expected warnings -should.exist json.geocoding.warnings -json.geocoding.warnings.should.eql [ 'boundary.circle is currently unsupported' ] - #? inputs -# json.geocoding.query['size'].should.eql 10 -# json.geocoding.query['point.lat'].should.eql 40.744243 -# json.geocoding.query['point.lon'].should.eql -73.990342 -# json.geocoding.query['boundary.circle.lat'].should.eql 40.744243 -# json.geocoding.query['boundary.circle.lon'].should.eql -73.990342 -# json.geocoding.query['boundary.circle.radius'].should.eql 999.9 +json.geocoding.query['size'].should.eql 10 +json.geocoding.query['point.lat'].should.eql 40.744243 +json.geocoding.query['point.lon'].should.eql -73.990342 +json.geocoding.query['boundary.circle.lat'].should.eql 40.744243 +json.geocoding.query['boundary.circle.lon'].should.eql -73.990342 +json.geocoding.query['boundary.circle.radius'].should.eql 999.9