testing/unexpected_passes_common/data_types_unittest.py
def testSemiStaleExpectations(self):
    """Tests output when only semi-stale expectations are provided."""
    expectation_map = data_types.TestExpectationMap({
        'foo':
        data_types.ExpectationBuilderMap({
            data_types.Expectation('foo', ['win'], ['Failure']):
            data_types.BuilderStepMap({
                'foo_builder':
                data_types.StepBuildStatsMap({
                    'step1':
                    uu.CreateStatsWithPassFails(1, 0),
                    'step2':
                    uu.CreateStatsWithPassFails(2, 2),
                }),
                'bar_builder':
                data_types.StepBuildStatsMap({
                    'step1':
                    uu.CreateStatsWithPassFails(3, 0),
                    'step2':
                    uu.CreateStatsWithPassFails(0, 4)
                }),
            }),
            data_types.Expectation('foo', ['linux'], ['RetryOnFailure']):
            data_types.BuilderStepMap({
                'foo_builder':
                data_types.StepBuildStatsMap({
                    'step1':
                    uu.CreateStatsWithPassFails(5, 0),
                    'step2':
                    uu.CreateStatsWithPassFails(6, 6),
                }),
            }),
        }),
        'bar':
        data_types.ExpectationBuilderMap({
            data_types.Expectation('bar', ['win'], ['Failure']):
            data_types.BuilderStepMap({
                'foo_builder':
                data_types.StepBuildStatsMap({
                    'step1':
                    uu.CreateStatsWithPassFails(7, 0),
                }),
                'bar_builder':
                data_types.StepBuildStatsMap({
                    'step1':
                    uu.CreateStatsWithPassFails(0, 8),
                }),
            }),
        }),
    })
    expected_semi_stale_dict = copy.deepcopy(expectation_map)
    stale_dict, semi_stale_dict, active_dict =\
        expectation_map.SplitByStaleness()
    self.assertEqual(stale_dict, {})
    self.assertEqual(semi_stale_dict, expected_semi_stale_dict)
    self.assertEqual(active_dict, {})
Tests output when only semi-stale expectations are provided.
Tests output when only semi-stale expectations are provided.
Tests output when only semi - stale expectations are provided .
def testSemiStaleExpectations(self):
    expectation_map = data_types.TestExpectationMap({
        'foo':
        data_types.ExpectationBuilderMap({
            data_types.Expectation('foo', ['win'], ['Failure']):
            data_types.BuilderStepMap({
                'foo_builder':
                data_types.StepBuildStatsMap({
                    'step1':
                    uu.CreateStatsWithPassFails(1, 0),
                    'step2':
                    uu.CreateStatsWithPassFails(2, 2),
                }),
                'bar_builder':
                data_types.StepBuildStatsMap({
                    'step1':
                    uu.CreateStatsWithPassFails(3, 0),
                    'step2':
                    uu.CreateStatsWithPassFails(0, 4)
                }),
            }),
            data_types.Expectation('foo', ['linux'], ['RetryOnFailure']):
            data_types.BuilderStepMap({
                'foo_builder':
                data_types.StepBuildStatsMap({
                    'step1':
                    uu.CreateStatsWithPassFails(5, 0),
                    'step2':
                    uu.CreateStatsWithPassFails(6, 6),
                }),
            }),
        }),
        'bar':
        data_types.ExpectationBuilderMap({
            data_types.Expectation('bar', ['win'], ['Failure']):
            data_types.BuilderStepMap({
                'foo_builder':
                data_types.StepBuildStatsMap({
                    'step1':
                    uu.CreateStatsWithPassFails(7, 0),
                }),
                'bar_builder':
                data_types.StepBuildStatsMap({
                    'step1':
                    uu.CreateStatsWithPassFails(0, 8),
                }),
            }),
        }),
    })
    expected_semi_stale_dict = copy.deepcopy(expectation_map)
    stale_dict, semi_stale_dict, active_dict =\
        expectation_map.SplitByStaleness()
    self.assertEqual(stale_dict, {})
    self.assertEqual(semi_stale_dict, expected_semi_stale_dict)
    self.assertEqual(active_dict, {})
def testSemiStaleExpectations ( self ) : expectation_map = data_types . TestExpectationMap ( { 'foo' : data_types . ExpectationBuilderMap ( { data_types . Expectation ( 'foo' , [ 'win' ] , [ 'Failure' ] ) : data_types . BuilderStepMap ( { 'foo_builder' : data_types . StepBuildStatsMap ( { 'step1' : uu . CreateStatsWithPassFails ( 1 , 0 ) , 'step2' : uu . CreateStatsWithPassFails ( 2 , 2 ) , } ) , 'bar_builder' : data_types . StepBuildStatsMap ( { 'step1' : uu . CreateStatsWithPassFails ( 3 , 0 ) , 'step2' : uu . CreateStatsWithPassFails ( 0 , 4 ) } ) , } ) , data_types . Expectation ( 'foo' , [ 'linux' ] , [ 'RetryOnFailure' ] ) : data_types . BuilderStepMap ( { 'foo_builder' : data_types . StepBuildStatsMap ( { 'step1' : uu . CreateStatsWithPassFails ( 5 , 0 ) , 'step2' : uu . CreateStatsWithPassFails ( 6 , 6 ) , } ) , } ) , } ) , 'bar' : data_types . ExpectationBuilderMap ( { data_types . Expectation ( 'bar' , [ 'win' ] , [ 'Failure' ] ) : data_types . BuilderStepMap ( { 'foo_builder' : data_types . StepBuildStatsMap ( { 'step1' : uu . CreateStatsWithPassFails ( 7 , 0 ) , } ) , 'bar_builder' : data_types . StepBuildStatsMap ( { 'step1' : uu . CreateStatsWithPassFails ( 0 , 8 ) , } ) , } ) , } ) , } ) expected_semi_stale_dict = copy . deepcopy ( expectation_map ) stale_dict , semi_stale_dict , active_dict = expectation_map . SplitByStaleness ( ) self . assertEqual ( stale_dict , { } ) self . assertEqual ( semi_stale_dict , expected_semi_stale_dict ) self . assertEqual ( active_dict , { } )
Tests output when only semi-stale expectations are provided.
Tests output when only semi - stale expectations are provided .
"""Tests output when only semi-stale expectations are provided."""
self