EOX GitLab Instance

Skip to content
Snippets Groups Projects
Commit 02a7b12f authored by Mussab Abdalla's avatar Mussab Abdalla
Browse files

test editing

parent 4768c36c
No related branches found
No related tags found
1 merge request!82Staging to master
......@@ -75,22 +75,24 @@ def test_preprocessor(list_tifs):
def test_error_logging():
with open('ingestor_log.txt', 'r') as log_file:
lines = log_file.read().splitlines()
error_lines = list(filter(lambda x: 'ERROR:' in x, lines))
xml_error_lines = list(filter(lambda x: 'lxml.etree.XMLSyntaxError' in x, lines))
log_file.close()
for line in lines:
if 'ERROR:' in line:
# check the error notification
assert 'Failed to parse XML.' in line
match = re.search(
'[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}', line)
date = datetime.datetime.strptime(
match.group(), "%Y-%m-%d %H:%M:%S").date()
# check the associated error time
assert type(date) == datetime.date
if 'lxml.etree.XMLSyntaxError' in line:
# Check the specific expected error reprot
error_msg = "Start tag expected, '<' not found, line 1, column 1"
assert error_msg in line
for line in error_lines:
# check the error notification
assert 'Failed to parse XML.' in line
match = re.search(
'[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}', line)
date = datetime.datetime.strptime(
match.group(), "%Y-%m-%d %H:%M:%S").date()
# check the associated error time
assert type(date) == datetime.date
for line in xml_error_lines:
# Check the specific expected error reprot
error_msg = "Start tag expected, '<' not found, line 1, column 1"
assert error_msg in line
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment