diff --git a/yml_tests/test_Baseline.yml b/yml_tests/test_Baseline.yml index 6a50544c..3bdabdaa 100644 --- a/yml_tests/test_Baseline.yml +++ b/yml_tests/test_Baseline.yml @@ -45,24 +45,6 @@ tests: expected file: csv expected code: 200 -- baseline processing level: - reference: ALPSRP279071410 - output: csv - processingLevel: L1.5 - # use_maturity: True - - expected file: csv - expected code: 200 - -- baseline processing level list: - reference: ALPSRP279071410 - output: csv - processingLevel: L1.5,L1.0 - # use_maturity: True - - expected file: csv - expected code: 200 - - baseline count: reference: E1_23942_STD_F155 output: count @@ -116,15 +98,7 @@ tests: output: json # use_maturity: True - expected file: json - expected code: 200 - -- baseline asf_search: - reference: S1B_IW_SLC__1SDV_20180112T141823_20180112T141850_009139_0105AA_E6F5 - output: asf_search - # use_maturity: True - - expected file: geojson + expected file: jsonlite # dropping json output expected code: 200 - no output specified: @@ -162,22 +136,6 @@ tests: expected file: error json expected code: 400 -- requested processingLevel does not exist: - reference: E1_20936_STD_F155 - processingLevel: L0.5 - # use_maturity: True - - expected file: jsonlite - expected code: 200 - -- missing stack ID: - reference: ALPSRS279162650 - processinglevel: L1.0 - # use_maturity: True - - expected file: error json - expected code: 400 - - Sentinel RAW without baseline: reference: S1B_EW_RAW__0SDH_20200408T180120_20200408T180228_021056_027F1A_8312 # use_maturity: True diff --git a/yml_tests/test_baseline_manager.py b/yml_tests/test_baseline_manager.py index 8ba051ce..b4ba02fb 100644 --- a/yml_tests/test_baseline_manager.py +++ b/yml_tests/test_baseline_manager.py @@ -1,3 +1,4 @@ +import logging import requests, urllib # For talking w/ API import json, csv # File stuff import re # Opening/Reading the file stuff @@ -129,6 +130,7 @@ def jsonToDict(json_data): h = requests.head(self.query) content_header = h.headers.get('content-type') file_content = requests.get(self.query).content.decode("utf-8") + # text/csv; charset=utf-8 try: content_type = content_header.split('/')[1] @@ -136,7 +138,7 @@ def jsonToDict(json_data): assert False, self.error_msg.format("Header is not formatted as expected. Header: {0}. File Content: \n{1}\n".format(content_header, file_content)) # Take out the "csv; charset=utf-8", without crahsing on things without charset content_type = content_type.split(';')[0] if ';' in content_type else content_type - + logging.warning(content_header) ## COUNT / HTML: if content_type == "html": # They return a number in the html. Convert to a real int: