diff --git a/yml_tests/helpers.py b/yml_tests/helpers.py index ad555185..d7537228 100644 --- a/yml_tests/helpers.py +++ b/yml_tests/helpers.py @@ -7,7 +7,7 @@ def make_request(full_url, files=None, data=None): if data is None: data = {} try: - r = requests.post(full_url, files=files, data=data) + r = requests.post(full_url, files=files, json=data) except (requests.ConnectionError, requests.Timeout, requests.TooManyRedirects) as e: assert False, "Cannot connect to API: {0}. Error: '{1}'.".format(full_url, str(e)) return r diff --git a/yml_tests/test_URLs_partial_pass.yml b/yml_tests/test_URLs_partial_pass.yml index fd5884a1..a1def942 100644 --- a/yml_tests/test_URLs_partial_pass.yml +++ b/yml_tests/test_URLs_partial_pass.yml @@ -11,8 +11,8 @@ tests: beamMode: TEST output: csv,count - expected file: blank metalink - expected code: 200 + expected file: error json + expected code: 400 - beamMode specchar blank: beamMode: $~ @@ -32,8 +32,8 @@ tests: beamSwath: TEST output: csv,count - expected file: blank metalink - expected code: 200 + expected file: error json + expected code: 400 - beamSwath specchar blank: beamSwath: ~! @@ -172,14 +172,14 @@ tests: groupid: 12345 output: json - expected file: blank json + expected file: blank jsonlite expected code: 200 - groupid hash blank: groupid: sdfkhgsdfkhgsdf output: json - expected file: blank json + expected file: blank jsonlite expected code: 200 - groupid TEST blank: @@ -200,35 +200,35 @@ tests: groupid: R1_57704_ST7_F173 output: json - expected file: blank json + expected file: blank jsonlite expected code: 200 - groupid ERS blank not in CMR: groupid: E2_84699_STD_F309 output: json - expected file: blank json + expected file: blank jsonlite expected code: 200 - groupid JERS blank not in CMR: groupid: J1_36439_STD_F268 output: json - expected file: blank json + expected file: blank jsonlite expected code: 200 - groupid Seasat blank not in CMR: groupid: SS_01502_STD output: json - expected file: blank json + expected file: blank jsonlite expected code: 200 - instrument test: instrument: test output: json - expected file: blank json + expected file: blank jsonlite expected code: 200 - instrument notvalid: @@ -245,7 +245,7 @@ tests: output: json maxResults: 100 - expected file: blank json + expected file: blank jsonlite expected code: 200 - output test: @@ -254,8 +254,8 @@ tests: output: TEST maxResults: 100 - expected file: metalink - expected code: 200 + expected file: error json + expected code: 400 - output csc: platform: S1 @@ -263,8 +263,8 @@ tests: maxResults: 1 output: CSC - expected file: metalink - expected code: 200 + expected file: error json + expected code: 400 - platform count RADARSAT-1 blank: platform: RADARSAT-1 diff --git a/yml_tests/test_WKTUtils.yml b/yml_tests/test_WKTUtils.yml index 28f96682..7cf4f641 100644 --- a/yml_tests/test_WKTUtils.yml +++ b/yml_tests/test_WKTUtils.yml @@ -2,10 +2,10 @@ tests: # REPAIR: - REPAIR Merge individual shapes together and reverse polygon order: test wkt: GEOMETRYCOLLECTION(POLYGON((46 -19,30 26,-3 41,22 39,49 16,46 -19)), POLYGON((27 24,12 4,18 31,27 24))) - repaired wkt: POLYGON ((46.0000000000000000 -19.0000000000000000, 49.0000000000000000 16.0000000000000000, 22.0000000000000000 39.0000000000000000, -3.0000000000000000 41.0000000000000000, 15.2549019607843128 18.6470588235294130, 12.0000000000000000 4.0000000000000000, 19.2845744680851077 13.7127659574468090, 46.0000000000000000 -19.0000000000000000)) + repaired wkt: POLYGON ((19.28457446808511 13.71276595744681, 46 -19, 49 16, 22 39, -3 41, 15.25490196078431 18.64705882352941, 12 4, 19.28457446808511 13.71276595744681)) repair: - - 'Unconnected shapes: Convex-halled each INDIVIDUAL shape to merge them together.' - - 'Reversed polygon winding order' + - '2 non-overlapping shapes merged by their convex-hulls' + # - 'Reversed polygon winding order' # FILE geojson: - FILE geojson smallest possible json: @@ -15,7 +15,7 @@ tests: # FILE kml: - File kml contains polygon point and line: file wkt: kmls_valid/Polygon_point_line.kml - parsed wkt: GEOMETRYCOLLECTION (POINT (-79.9165174000000000 47.2629855000000000 0.0000000000000000),POLYGON ((-81.6084120000000000 36.5963103000000000 0.0000000000000000, -82.1577284000000000 36.1362865000000000 0.0000000000000000, -82.7729628000000000 36.0119699000000000 0.0000000000000000, -83.1025526000000000 35.7449162000000000 0.0000000000000000, -83.9594862000000000 35.5485053000000000 0.0000000000000000, -84.0473768000000000 35.2798953000000000 0.0000000000000000, -84.3110487000000000 35.3157617000000000 0.0000000000000000, -84.2890760000000000 34.9563835000000000 0.0000000000000000, -83.0366346000000000 34.9743901000000000 0.0000000000000000, -82.4433729000000000 35.1542378000000000 0.0000000000000000, -81.0590956000000000 35.1183000000000000 0.0000000000000000, -80.7734510000000000 34.8121887000000000 0.0000000000000000, -79.6967909000000000 34.8302269000000000 0.0000000000000000, -78.4663221000000000 33.7957745000000000 0.0000000000000000, -76.4887831000000000 34.6858109000000000 0.0000000000000000, -75.7417128000000000 35.5663808000000000 0.0000000000000000, -75.8515760000000000 36.5610205000000000 0.0000000000000000, -81.6084120000000000 36.5963103000000000 0.0000000000000000)),LINESTRING (-83.4541151000000000 40.1269874000000000 0.0000000000000000, -83.1025526000000000 39.4686070000000000 0.0000000000000000, -81.6084120000000000 39.6887673000000000 0.0000000000000000, -82.1357557000000000 40.3282965000000000 0.0000000000000000)) + parsed wkt: GEOMETRYCOLLECTION (POINT (-79.9165174000000000 47.2629855000000000 0),POLYGON ((-81.6084120000000000 36.5963103000000000 0, -82.1577284000000000 36.1362865000000000 0, -82.7729628000000000 36.0119699000000000 0, -83.1025526000000000 35.7449162000000000 0, -83.9594862000000000 35.5485053000000000 0, -84.0473768000000000 35.2798953000000000 0, -84.3110487000000000 35.3157617000000000 0, -84.2890760000000000 34.9563835000000000 0, -83.0366346000000000 34.9743901000000000 0, -82.4433729000000000 35.1542378000000000 0, -81.0590956000000000 35.1183000000000000 0, -80.7734510000000000 34.8121887000000000 0, -79.6967909000000000 34.8302269000000000 0, -78.4663221000000000 33.7957745000000000 0, -76.4887831000000000 34.6858109000000000 0, -75.7417128000000000 35.5663808000000000 0, -75.8515760000000000 36.5610205000000000 0, -81.6084120000000000 36.5963103000000000 0)),LINESTRING (-83.4541151000000000 40.1269874000000000 0, -83.1025526000000000 39.4686070000000000 0, -81.6084120000000000 39.6887673000000000 0, -82.1357557000000000 40.3282965000000000 0)) # FILE shp: - FILE shp PIGSearch basic parse: