testing/unexpected_passes_common/data_types_unittest.py
def testMergeBuildStats(self):
    """Tests that BuildStats for the same step are merged properly."""
    base_map = data_types.TestExpectationMap({
        'foo':
        data_types.ExpectationBuilderMap({
            data_types.Expectation('foo', ['win'], 'Failure'):
            data_types.BuilderStepMap({
                'builder':
                data_types.StepBuildStatsMap({
                    'step': data_types.BuildStats(),
                }),
            }),
        }),
    })
    merge_stats = data_types.BuildStats()
    merge_stats.AddFailedBuild('1')
    merge_map = data_types.TestExpectationMap({
        'foo':
        data_types.ExpectationBuilderMap({
            data_types.Expectation('foo', ['win'], 'Failure'):
            data_types.BuilderStepMap({
                'builder':
                data_types.StepBuildStatsMap({
                    'step': merge_stats,
                }),
            }),
        }),
    })
    expected_stats = data_types.BuildStats()
    expected_stats.AddFailedBuild('1')
    expected_base_map = {
        'foo': {
            data_types.Expectation('foo', ['win'], 'Failure'): {
                'builder': {
                    'step': expected_stats,
                },
            },
        },
    }
    base_map.Merge(merge_map)
    self.assertEqual(base_map, expected_base_map)
Tests that BuildStats for the same step are merged properly.
Tests that BuildStats for the same step are merged properly.
Tests that BuildStats for the same step are merged properly .
def testMergeBuildStats(self):
    base_map = data_types.TestExpectationMap({
        'foo':
        data_types.ExpectationBuilderMap({
            data_types.Expectation('foo', ['win'], 'Failure'):
            data_types.BuilderStepMap({
                'builder':
                data_types.StepBuildStatsMap({
                    'step': data_types.BuildStats(),
                }),
            }),
        }),
    })
    merge_stats = data_types.BuildStats()
    merge_stats.AddFailedBuild('1')
    merge_map = data_types.TestExpectationMap({
        'foo':
        data_types.ExpectationBuilderMap({
            data_types.Expectation('foo', ['win'], 'Failure'):
            data_types.BuilderStepMap({
                'builder':
                data_types.StepBuildStatsMap({
                    'step': merge_stats,
                }),
            }),
        }),
    })
    expected_stats = data_types.BuildStats()
    expected_stats.AddFailedBuild('1')
    expected_base_map = {
        'foo': {
            data_types.Expectation('foo', ['win'], 'Failure'): {
                'builder': {
                    'step': expected_stats,
                },
            },
        },
    }
    base_map.Merge(merge_map)
    self.assertEqual(base_map, expected_base_map)
def testMergeBuildStats ( self ) : base_map = data_types . TestExpectationMap ( { 'foo' : data_types . ExpectationBuilderMap ( { data_types . Expectation ( 'foo' , [ 'win' ] , 'Failure' ) : data_types . BuilderStepMap ( { 'builder' : data_types . StepBuildStatsMap ( { 'step' : data_types . BuildStats ( ) , } ) , } ) , } ) , } ) merge_stats = data_types . BuildStats ( ) merge_stats . AddFailedBuild ( '1' ) merge_map = data_types . TestExpectationMap ( { 'foo' : data_types . ExpectationBuilderMap ( { data_types . Expectation ( 'foo' , [ 'win' ] , 'Failure' ) : data_types . BuilderStepMap ( { 'builder' : data_types . StepBuildStatsMap ( { 'step' : merge_stats , } ) , } ) , } ) , } ) expected_stats = data_types . BuildStats ( ) expected_stats . AddFailedBuild ( '1' ) expected_base_map = { 'foo' : { data_types . Expectation ( 'foo' , [ 'win' ] , 'Failure' ) : { 'builder' : { 'step' : expected_stats , } , } , } , } base_map . Merge ( merge_map ) self . assertEqual ( base_map , expected_base_map )
Tests that BuildStats for the same step are merged properly.
Tests that BuildStats for the same step are merged properly .
"""Tests that BuildStats for the same step are merged properly."""
self