testing/unexpected_passes_common/data_types_unittest.py
def testInvalidMerge(self):
    """Tests that updating a BuildStats instance twice is an error."""
    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,
                }),
            }),
        }),
    })
    original_base_map = copy.deepcopy(base_map)
    base_map.Merge(merge_map, original_base_map)
    with self.assertRaises(AssertionError):
      base_map.Merge(merge_map, original_base_map)
Tests that updating a BuildStats instance twice is an error.
Tests that updating a BuildStats instance twice is an error.
Tests that updating a BuildStats instance twice is an error .
def testInvalidMerge(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,
                }),
            }),
        }),
    })
    original_base_map = copy.deepcopy(base_map)
    base_map.Merge(merge_map, original_base_map)
    with self.assertRaises(AssertionError):
      base_map.Merge(merge_map, original_base_map)
def testInvalidMerge ( 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 , } ) , } ) , } ) , } ) original_base_map = copy . deepcopy ( base_map ) base_map . Merge ( merge_map , original_base_map ) with self . assertRaises ( AssertionError ) : base_map . Merge ( merge_map , original_base_map )
Tests that updating a BuildStats instance twice is an error.
Tests that updating a BuildStats instance twice is an error .
"""Tests that updating a BuildStats instance twice is an error."""
self