testing/unexpected_passes_common/result_output_unittest.py
def testRecursivePrintToFileUnmatchedResults(self):
    """Tests RecursivePrintToFile() with unmatched results as input."""
    unmatched_results = {
        'foo': {
            'builder': {
                None: [
                    'Expected "" on http://ci.chromium.org/b/build_id, got '
                    '"Failure" with tags []',
                ],
                'step_name': [
                    'Expected "Failure RetryOnFailure" on '
                    'http://ci.chromium.org/b/build_id, got '
                    '"Failure" with tags [win intel]',
                ]
            },
        },
    }
    result_output.RecursivePrintToFile(unmatched_results, 0, self._file_handle)
    self._file_handle.close()
    # pylint: disable=line-too-long
    # Order is not guaranteed, so create permutations.
    expected_template = """\
foo
  builder%s
"""
    values = [
        """
    None
      Expected "" on http://ci.chromium.org/b/build_id, got "Failure" with tags []\
""",
        """
    step_name
      Expected "Failure RetryOnFailure" on http://ci.chromium.org/b/build_id, got "Failure" with tags [win intel]\
""",
    ]
    expected_output = CreateTextOutputPermutations(expected_template, values)
    # pylint: enable=line-too-long
    with open(self._filepath) as f:
      self.assertIn(f.read(), expected_output)
Tests RecursivePrintToFile() with unmatched results as input.
Tests RecursivePrintToFile() with unmatched results as input.
Tests RecursivePrintToFile () with unmatched results as input .
def testRecursivePrintToFileUnmatchedResults(self):
    unmatched_results = {
        'foo': {
            'builder': {
                None: [
                    'Expected "" on http://ci.chromium.org/b/build_id, got '
                    '"Failure" with tags []',
                ],
                'step_name': [
                    'Expected "Failure RetryOnFailure" on '
                    'http://ci.chromium.org/b/build_id, got '
                    '"Failure" with tags [win intel]',
                ]
            },
        },
    }
    result_output.RecursivePrintToFile(unmatched_results, 0, self._file_handle)
    self._file_handle.close()
    expected_template = """\
foo
  builder%s
"""
    values = [
        """
    None
      Expected "" on http://ci.chromium.org/b/build_id, got "Failure" with tags []\
""",
        """
    step_name
      Expected "Failure RetryOnFailure" on http://ci.chromium.org/b/build_id, got "Failure" with tags [win intel]\
""",
    ]
    expected_output = CreateTextOutputPermutations(expected_template, values)
    with open(self._filepath) as f:
      self.assertIn(f.read(), expected_output)
def testRecursivePrintToFileUnmatchedResults ( self ) : unmatched_results = { 'foo' : { 'builder' : { None : [ 'Expected "" on http://ci.chromium.org/b/build_id, got ' '"Failure" with tags []' , ] , 'step_name' : [ 'Expected "Failure RetryOnFailure" on ' 'http://ci.chromium.org/b/build_id, got ' '"Failure" with tags [win intel]' , ] } , } , } result_output . RecursivePrintToFile ( unmatched_results , 0 , self . _file_handle ) self . _file_handle . close ( ) expected_template = """\
foo
  builder%s
""" values = [ """
    None
      Expected "" on http://ci.chromium.org/b/build_id, got "Failure" with tags []\
""" , """
    step_name
      Expected "Failure RetryOnFailure" on http://ci.chromium.org/b/build_id, got "Failure" with tags [win intel]\
""" , ] expected_output = CreateTextOutputPermutations ( expected_template , values ) with open ( self . _filepath ) as f : self . assertIn ( f . read ( ) , expected_output )
Tests RecursivePrintToFile() with unmatched results as input.
Tests RecursivePrintToFile () with unmatched results as input .
"""Tests RecursivePrintToFile() with unmatched results as input.""" # pylint: disable=line-too-long # Order is not guaranteed, so create permutations. # pylint: enable=line-too-long
self