Skip to content

Commit a39b78b

Browse files
committedJun 1, 2013
Removing a couple more delimited text file test case failures
1 parent 24bffbf commit a39b78b

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed
 

‎tests/src/python/test_qgsdelimitedtextprovider.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,10 @@ def delimitedTextData( testname, filename, requests, verbose, **params ):
176176
if not rdata:
177177
log.append("Request "+str(nr)+" did not return any data")
178178
for msg in logger.messages():
179-
log.append(msg.replace(filepath,'file'))
179+
filelogname = 'temp_file' if 'tmp' in filename.lower() else filename
180+
msg = re.sub(r'file\s+.*'+re.escape(filename),'file '+filelogname,msg)
181+
msg = msg.replace(filepath,filelogname)
182+
log.append(msg);
180183
return dict( fields=fields, fieldTypes=fieldTypes, data=data, log=log, uri=uri)
181184

182185
def printWanted( testname, result ):

‎tests/src/python/test_qgsdelimitedtextprovider_wanted.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ def test_007_multiple_quote():
330330
},
331331
}
332332
wanted['log']=[
333-
u'Errors in file file',
333+
u'Errors in file test.quote',
334334
u'3 records discarded due to invalid format',
335335
u'The following lines were not loaded into QGIS due to errors:',
336336
u'Invalid record format at line 7',
@@ -355,7 +355,7 @@ def test_008_badly_formed_quotes():
355355
},
356356
}
357357
wanted['log']=[
358-
u'Errors in file file',
358+
u'Errors in file test.badquote',
359359
u'2 records discarded due to invalid format',
360360
u'The following lines were not loaded into QGIS due to errors:',
361361
u'Invalid record format at line 2',
@@ -415,7 +415,7 @@ def test_010_read_coordinates():
415415
},
416416
}
417417
wanted['log']=[
418-
u'Errors in file file',
418+
u'Errors in file testpt.csv',
419419
u'1 records discarded due to invalid geometry definitions',
420420
u'The following lines were not loaded into QGIS due to errors:',
421421
u'Invalid X or Y fields at line 4',
@@ -460,7 +460,7 @@ def test_011_read_wkt():
460460
},
461461
}
462462
wanted['log']=[
463-
u'Errors in file file',
463+
u'Errors in file testwkt.csv',
464464
u'1 records discarded due to invalid geometry definitions',
465465
u'7 records discarded due to incompatible geometry types',
466466
u'The following lines were not loaded into QGIS due to errors:',
@@ -506,7 +506,7 @@ def test_012_read_wkt_point():
506506
},
507507
}
508508
wanted['log']=[
509-
u'Errors in file file',
509+
u'Errors in file testwkt.csv',
510510
u'1 records discarded due to invalid geometry definitions',
511511
u'7 records discarded due to incompatible geometry types',
512512
u'The following lines were not loaded into QGIS due to errors:',
@@ -552,7 +552,7 @@ def test_013_read_wkt_line():
552552
},
553553
}
554554
wanted['log']=[
555-
u'Errors in file file',
555+
u'Errors in file testwkt.csv',
556556
u'1 records discarded due to invalid geometry definitions',
557557
u'7 records discarded due to incompatible geometry types',
558558
u'The following lines were not loaded into QGIS due to errors:',
@@ -580,7 +580,7 @@ def test_014_read_wkt_polygon():
580580
},
581581
}
582582
wanted['log']=[
583-
u'Errors in file file',
583+
u'Errors in file testwkt.csv',
584584
u'1 records discarded due to invalid geometry definitions',
585585
u'10 records discarded due to incompatible geometry types',
586586
u'The following lines were not loaded into QGIS due to errors:',
@@ -748,7 +748,7 @@ def test_015_read_dms_xy():
748748
},
749749
}
750750
wanted['log']=[
751-
u'Errors in file file',
751+
u'Errors in file testdms.csv',
752752
u'5 records discarded due to invalid geometry definitions',
753753
u'The following lines were not loaded into QGIS due to errors:',
754754
u'Invalid X or Y fields at line 27',
@@ -878,7 +878,7 @@ def test_019_regular_expression_3():
878878
},
879879
}
880880
wanted['log']=[
881-
u'Errors in file file',
881+
u'Errors in file testre2.txt',
882882
u'1 records discarded due to invalid format',
883883
u'The following lines were not loaded into QGIS due to errors:',
884884
u'Invalid record format at line 3',
@@ -1372,9 +1372,9 @@ def test_029_file_watcher():
13721372
'Request 2 did not return any data',
13731373
'Request 7 did not return any data',
13741374
'Request 11 did not return any data',
1375-
u'Errors in file file',
1375+
u'Errors in file temp_file',
13761376
u'The file has been updated by another application - reloading',
1377-
u'Errors in file file',
1377+
u'Errors in file temp_file',
13781378
u'The file has been updated by another application - reloading',
13791379
]
13801380
return wanted
@@ -2157,7 +2157,7 @@ def test_036_csvt_file_invalid_types():
21572157
},
21582158
}
21592159
wanted['log']=[
2160-
u'Errors in file file',
2160+
u'Errors in file testcsvt3.csv',
21612161
u'File type string in testcsvt3.csvt is not correctly formatted',
21622162
]
21632163
return wanted

1 commit comments

Comments
 (1)

ccrook commented on Jun 1, 2013

@ccrook
ContributorAuthor

Hopefully this will fix windows file name mismatches on osgeo build. Will not fix file watcher test case failures...

Please sign in to comment.