def testMinimalData(self): """Tests that everything functions when minimal data is provided.""" unmatched_results = { 'builder': [ data_types.Result('foo', [], 'Failure', None, 'build_id'), ], } expected_output = { 'foo': { 'builder': { None: [ 'Got "Failure" on http://ci.chromium.org/b/build_id with ' 'tags []', ], }, }, } output = result_output._ConvertUnmatchedResultsToStringDict( unmatched_results) self.assertEqual(output, expected_output)
def testRegularData(self): """Tests that everything functions when regular data is provided.""" unmatched_results = { 'builder': [ data_types.Result('foo', ['win', 'intel'], 'Failure', 'step_name', 'build_id') ], } expected_output = { 'foo': { 'builder': { 'step_name': [ 'Got "Failure" on http://ci.chromium.org/b/build_id with ' 'tags [win intel]', ] } } } output = result_output._ConvertUnmatchedResultsToStringDict( unmatched_results) self.assertEqual(output, expected_output)
def testEmptyResults(self): """Tests that providing empty results is a no-op.""" self.assertEqual(result_output._ConvertUnmatchedResultsToStringDict({}), {})