Skip to content

Commit a7fe51f

Browse files
committed
more specific error report for eca2csv
1 parent 2d0298b commit a7fe51f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/eca2csvTest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ def testMethod():
2222
if hash != '87defdce3b585d4fe3d59be8a07d61e1':
2323
return False, f"'climate-noheader-no2020.txt' does not contain exactly what is expected"
2424
with open('climate-cleaned.txt') as cnh:
25-
hash = hashlib.md5(cnh.read().strip().encode('utf-8')).hexdigest()
25+
content = cnh.read().strip()
26+
if not '19010225' in content:
27+
return False, "'climate-cleaned.txt' appears to be missing data for 19010225"
28+
hash = hashlib.md5(content.encode('utf-8')).hexdigest()
2629
if hash != 'aa7138f0b4e8eb25a5982afe21ef79f0':
2730
return False, f"'climate-cleaned.txt' does not contain exactly what is expected"
2831
with open('climate.csv') as cnh:

0 commit comments

Comments
 (0)