def test_summarize_duplicate_results(self): r = WPTReport() r._report = {'results': [ { 'test': '/js/with-statement.html', 'status': 'OK', 'message': None, 'subtests': [ {'status': 'PASS', 'message': None, 'name': 'first'}, {'status': 'FAIL', 'message': 'bad', 'name': 'second'} ] }, { 'test': '/js/with-statement.html', 'status': 'OK', 'message': None, 'subtests': [ {'status': 'PASS', 'message': None, 'name': 'first'}, {'status': 'FAIL', 'message': 'bad', 'name': 'second'}, {'status': 'FAIL', 'message': 'bad', 'name': 'third'}, {'status': 'FAIL', 'message': 'bad', 'name': 'fourth'} ] } ]} with self.assertRaises(ConflictingDataError): r.summarize()
def test_summarize(self): r = WPTReport() r._report = {'results': [ { 'test': '/js/with-statement.html', 'status': 'OK', 'message': None, 'subtests': [ {'status': 'PASS', 'message': None, 'name': 'first'}, {'status': 'FAIL', 'message': 'bad', 'name': 'second'} ] }, { 'test': '/js/isNaN.html', 'status': 'OK', 'message': None, 'subtests': [ {'status': 'PASS', 'message': None, 'name': 'first'}, {'status': 'FAIL', 'message': 'bad', 'name': 'second'}, {'status': 'PASS', 'message': None, 'name': 'third'} ] } ]} self.assertEqual(r.summarize(), { '/js/with-statement.html': [2, 3], '/js/isNaN.html': [3, 4] })
def test_summarize_whitespaces(self): r = WPTReport() r._report = { 'results': [{ 'test': ' /ref/reftest.html', 'status': 'PASS', 'message': None, 'subtests': [] }, { 'test': '/ref/reftest-fail.html\n', 'status': 'FAIL', 'message': None, 'subtests': [] }] } self.assertEqual(r.summarize(), { '/ref/reftest.html': [1, 1], '/ref/reftest-fail.html': [0, 1] })
def test_summarize_zero_results(self): r = WPTReport() with self.assertRaises(InsufficientDataError): r.summarize()
def test_summarize_zero_results(self): r = WPTReport() # Do not throw! r.summarize()