@@ -295,7 +295,18 @@ def get_xml_uri(self, attempt_id, target_name):
295
295
self .assertTrue (xml_data ['can_be_analyzed' ][0 ])
296
296
self .assertIsNone (xml_data ['annotations' ])
297
297
self .assertEqual (xml_data ['uri' ], expected_response ['uri' ])
298
- self .assertIsNone (xml_data ['validation_errors' ])
298
+ expect_errors = {
299
+ 'error_lines' : '1' ,
300
+ 'results' : [
301
+ {
302
+ 'column' : 6 ,
303
+ 'line' : 1 ,
304
+ 'message' : u'Premature end of data in tag xml line 1, line 1, column 6' ,
305
+ 'level' : 'ERROR'
306
+ }
307
+ ]
308
+ }
309
+ self .assertEqual (xml_data ['validation_errors' ], expect_errors )
299
310
self .assertEqual (xml_data ['file_name' ], expected_response ['filename' ])
300
311
301
312
def test_annotations_warning_if_balaio_breaks (self ):
@@ -366,14 +377,21 @@ def get_xml_uri(self, attempt_id, target_name):
366
377
self .assertEqual (xml_data ['uri' ], expected_response ['uri' ])
367
378
self .assertEqual (xml_data ['file_name' ], expected_response ['filename' ])
368
379
self .assertIsNotNone (xml_data ['validation_errors' ])
369
- self .assertEqual ('' , xml_data ['validation_errors' ]['error_lines' ])
380
+ self .assertEqual ('1 ' , xml_data ['validation_errors' ]['error_lines' ])
370
381
self .assertEqual (1 , len (xml_data ['validation_errors' ]['results' ]))
371
- self .assertEqual (
372
- xml_data ['validation_errors' ]['results' ],
373
- [{'column' : '--' ,
374
- 'line' : '--' ,
375
- 'message' : u"Element 'funding-group': This element is not filled-in correctly." ,
376
- 'level' : u'ERROR' }])
382
+ expect_errors = {
383
+ 'error_lines' : '1' ,
384
+ 'results' : [
385
+ {
386
+ 'column' : 6 ,
387
+ 'line' : 1 ,
388
+ 'message' : u'Premature end of data in tag xml line 1, line 1, column 6' ,
389
+ 'level' : 'ERROR'
390
+ }
391
+ ]
392
+ }
393
+ self .assertEqual (xml_data ['validation_errors' ], expect_errors )
394
+
377
395
378
396
def test_xml_not_found (self ):
379
397
self ._addWaffleFlag ()
@@ -406,11 +424,22 @@ def get_xml_uri(self, attempt_id, target_name):
406
424
407
425
self .assertEqual (response .status_code , 200 )
408
426
self .assertFalse (xml_data ['can_be_analyzed' ][0 ])
409
- self .assertEqual (xml_data ['can_be_analyzed' ][1 ], "Error while starting Stylechecker.XML()" )
427
+ self .assertEqual (xml_data ['can_be_analyzed' ][1 ], "IOError while starting Stylechecker.XML(), please verify if the input is correct " )
410
428
self .assertIsNone (xml_data ['annotations' ])
411
429
self .assertEqual (xml_data ['uri' ], expected_response ['uri' ])
412
430
self .assertEqual (xml_data ['file_name' ], expected_response ['filename' ])
413
- self .assertIsNone (xml_data ['validation_errors' ])
431
+ expect_errors = {
432
+ 'error_lines' : '1' ,
433
+ 'results' : [
434
+ {
435
+ 'column' : 6 ,
436
+ 'line' : 1 ,
437
+ 'message' : u'Premature end of data in tag xml line 1, line 1, column 6' ,
438
+ 'level' : 'ERROR'
439
+ }
440
+ ]
441
+ }
442
+ self .assertEqual (xml_data ['validation_errors' ], expect_errors )
414
443
415
444
def test_annotations_of_syntax_error (self ):
416
445
self ._addWaffleFlag ()
0 commit comments