testing/unexpected_passes_common/data_types_unittest.py
def testMultipleResults(self):
    """Tests that behavior is as expected when multiple results are given."""
    r1 = data_types.Result('some/test/case', ['win'], 'Pass', 'pixel_tests',
                           'build_id')
    r2 = data_types.Result('some/test/case', ['linux'], 'Pass', 'pixel_tests',
                           'build_id')
    r3 = data_types.Result('some/other/test', ['win'], 'Pass', 'pixel_tests',
                           'build_id')
    r4 = data_types.Result('some/other/test', ['linux'], 'Pass', 'pixel_tests',
                           'build_id')
    r5 = data_types.Result('some/other/other/test', ['win'], 'Pass',
                           'pixel_tests', 'build_id')
    r6 = data_types.Result('some/other/other/test', ['linux'], 'Pass',
                           'pixel_tests', 'build_id')
    e1 = data_types.Expectation('some/test/case', [], 'Failure')
    e2 = data_types.Expectation('some/other/test', ['win'], 'Failure')
    e3 = data_types.Expectation('some/other/other/test', ['mac'], 'Failure')
    expectation_map = data_types.TestExpectationMap({
        'expectation_file':
        data_types.ExpectationBuilderMap({
            e1: data_types.BuilderStepMap(),
            e2: data_types.BuilderStepMap(),
            e3: data_types.BuilderStepMap(),
        })
    })
    grouped_results = {
        'some/test/case': [r1, r2],
        'some/other/test': [r3, r4],
        'some/other/other/test': [r5, r6],
    }
    matched_results = expectation_map._AddGroupedResults(
        grouped_results, 'builder', None)
    self.assertEqual(matched_results, set([r1, r2, r3]))
    stats1 = data_types.BuildStats()
    stats1.AddPassedBuild()
    stats1.AddPassedBuild()
    stats2 = data_types.BuildStats()
    stats2.AddPassedBuild()
    expected_expectation_map = {
        'expectation_file': {
            e1: {
                'builder': {
                    'pixel_tests': stats1,
                },
            },
            e2: {
                'builder': {
                    'pixel_tests': stats2,
                },
            },
            e3: {},
        }
    }
    self.assertEqual(expectation_map, expected_expectation_map)
Tests that behavior is as expected when multiple results are given.
Tests that behavior is as expected when multiple results are given.
Tests that behavior is as expected when multiple results are given .
def testMultipleResults(self):
    r1 = data_types.Result('some/test/case', ['win'], 'Pass', 'pixel_tests',
                           'build_id')
    r2 = data_types.Result('some/test/case', ['linux'], 'Pass', 'pixel_tests',
                           'build_id')
    r3 = data_types.Result('some/other/test', ['win'], 'Pass', 'pixel_tests',
                           'build_id')
    r4 = data_types.Result('some/other/test', ['linux'], 'Pass', 'pixel_tests',
                           'build_id')
    r5 = data_types.Result('some/other/other/test', ['win'], 'Pass',
                           'pixel_tests', 'build_id')
    r6 = data_types.Result('some/other/other/test', ['linux'], 'Pass',
                           'pixel_tests', 'build_id')
    e1 = data_types.Expectation('some/test/case', [], 'Failure')
    e2 = data_types.Expectation('some/other/test', ['win'], 'Failure')
    e3 = data_types.Expectation('some/other/other/test', ['mac'], 'Failure')
    expectation_map = data_types.TestExpectationMap({
        'expectation_file':
        data_types.ExpectationBuilderMap({
            e1: data_types.BuilderStepMap(),
            e2: data_types.BuilderStepMap(),
            e3: data_types.BuilderStepMap(),
        })
    })
    grouped_results = {
        'some/test/case': [r1, r2],
        'some/other/test': [r3, r4],
        'some/other/other/test': [r5, r6],
    }
    matched_results = expectation_map._AddGroupedResults(
        grouped_results, 'builder', None)
    self.assertEqual(matched_results, set([r1, r2, r3]))
    stats1 = data_types.BuildStats()
    stats1.AddPassedBuild()
    stats1.AddPassedBuild()
    stats2 = data_types.BuildStats()
    stats2.AddPassedBuild()
    expected_expectation_map = {
        'expectation_file': {
            e1: {
                'builder': {
                    'pixel_tests': stats1,
                },
            },
            e2: {
                'builder': {
                    'pixel_tests': stats2,
                },
            },
            e3: {},
        }
    }
    self.assertEqual(expectation_map, expected_expectation_map)
def testMultipleResults ( self ) : r1 = data_types . Result ( 'some/test/case' , [ 'win' ] , 'Pass' , 'pixel_tests' , 'build_id' ) r2 = data_types . Result ( 'some/test/case' , [ 'linux' ] , 'Pass' , 'pixel_tests' , 'build_id' ) r3 = data_types . Result ( 'some/other/test' , [ 'win' ] , 'Pass' , 'pixel_tests' , 'build_id' ) r4 = data_types . Result ( 'some/other/test' , [ 'linux' ] , 'Pass' , 'pixel_tests' , 'build_id' ) r5 = data_types . Result ( 'some/other/other/test' , [ 'win' ] , 'Pass' , 'pixel_tests' , 'build_id' ) r6 = data_types . Result ( 'some/other/other/test' , [ 'linux' ] , 'Pass' , 'pixel_tests' , 'build_id' ) e1 = data_types . Expectation ( 'some/test/case' , [ ] , 'Failure' ) e2 = data_types . Expectation ( 'some/other/test' , [ 'win' ] , 'Failure' ) e3 = data_types . Expectation ( 'some/other/other/test' , [ 'mac' ] , 'Failure' ) expectation_map = data_types . TestExpectationMap ( { 'expectation_file' : data_types . ExpectationBuilderMap ( { e1 : data_types . BuilderStepMap ( ) , e2 : data_types . BuilderStepMap ( ) , e3 : data_types . BuilderStepMap ( ) , } ) } ) grouped_results = { 'some/test/case' : [ r1 , r2 ] , 'some/other/test' : [ r3 , r4 ] , 'some/other/other/test' : [ r5 , r6 ] , } matched_results = expectation_map . _AddGroupedResults ( grouped_results , 'builder' , None ) self . assertEqual ( matched_results , set ( [ r1 , r2 , r3 ] ) ) stats1 = data_types . BuildStats ( ) stats1 . AddPassedBuild ( ) stats1 . AddPassedBuild ( ) stats2 = data_types . BuildStats ( ) stats2 . AddPassedBuild ( ) expected_expectation_map = { 'expectation_file' : { e1 : { 'builder' : { 'pixel_tests' : stats1 , } , } , e2 : { 'builder' : { 'pixel_tests' : stats2 , } , } , e3 : { } , } } self . assertEqual ( expectation_map , expected_expectation_map )
Tests that behavior is as expected when multiple results are given.
Tests that behavior is as expected when multiple results are given .
"""Tests that behavior is as expected when multiple results are given."""
self