testing/unexpected_passes_common/data_types_unittest.py
def testAllExpectations(self):
    """Tests output when all three types of expectations are provided."""
    expectation_map = data_types.TestExpectationMap({
        'foo':
        data_types.ExpectationBuilderMap({
            data_types.Expectation('foo', ['stale'], 'Failure'):
            data_types.BuilderStepMap({
                'foo_builder':
                data_types.StepBuildStatsMap({
                    'step1':
                    uu.CreateStatsWithPassFails(1, 0),
                    'step2':
                    uu.CreateStatsWithPassFails(2, 0),
                }),
                'bar_builder':
                data_types.StepBuildStatsMap({
                    'step1':
                    uu.CreateStatsWithPassFails(3, 0),
                    'step2':
                    uu.CreateStatsWithPassFails(4, 0)
                }),
            }),
            data_types.Expectation('foo', ['semistale'], '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', ['active'], 'Failure'):
            data_types.BuilderStepMap({
                'foo_builder':
                data_types.StepBuildStatsMap({
                    'step1':
                    uu.CreateStatsWithPassFails(1, 1),
                    'step2':
                    uu.CreateStatsWithPassFails(2, 2),
                }),
                'bar_builder':
                data_types.StepBuildStatsMap({
                    'step1':
                    uu.CreateStatsWithPassFails(3, 3),
                    'step2':
                    uu.CreateStatsWithPassFails(0, 4)
                }),
            }),
        }),
    })
    expected_stale = {
        'foo': {
            data_types.Expectation('foo', ['stale'], 'Failure'): {
                'foo_builder': {
                    'step1': uu.CreateStatsWithPassFails(1, 0),
                    'step2': uu.CreateStatsWithPassFails(2, 0),
                },
                'bar_builder': {
                    'step1': uu.CreateStatsWithPassFails(3, 0),
                    'step2': uu.CreateStatsWithPassFails(4, 0)
                },
            },
        },
    }
    expected_semi_stale = {
        'foo': {
            data_types.Expectation('foo', ['semistale'], 'Failure'): {
                'foo_builder': {
                    'step1': uu.CreateStatsWithPassFails(1, 0),
                    'step2': uu.CreateStatsWithPassFails(2, 2),
                },
                'bar_builder': {
                    'step1': uu.CreateStatsWithPassFails(3, 0),
                    'step2': uu.CreateStatsWithPassFails(0, 4)
                },
            },
        },
    }
    expected_active = {
        'foo': {
            data_types.Expectation('foo', ['active'], 'Failure'): {
                'foo_builder': {
                    'step1': uu.CreateStatsWithPassFails(1, 1),
                    'step2': uu.CreateStatsWithPassFails(2, 2),
                },
                'bar_builder': {
                    'step1': uu.CreateStatsWithPassFails(3, 3),
                    'step2': uu.CreateStatsWithPassFails(0, 4)
                },
            },
        },
    }

    stale_dict, semi_stale_dict, active_dict =\
        expectation_map.SplitByStaleness()
    self.assertEqual(stale_dict, expected_stale)
    self.assertEqual(semi_stale_dict, expected_semi_stale)
    self.assertEqual(active_dict, expected_active)
Tests output when all three types of expectations are provided.
Tests output when all three types of expectations are provided.
Tests output when all three types of expectations are provided .
def testAllExpectations(self):
    expectation_map = data_types.TestExpectationMap({
        'foo':
        data_types.ExpectationBuilderMap({
            data_types.Expectation('foo', ['stale'], 'Failure'):
            data_types.BuilderStepMap({
                'foo_builder':
                data_types.StepBuildStatsMap({
                    'step1':
                    uu.CreateStatsWithPassFails(1, 0),
                    'step2':
                    uu.CreateStatsWithPassFails(2, 0),
                }),
                'bar_builder':
                data_types.StepBuildStatsMap({
                    'step1':
                    uu.CreateStatsWithPassFails(3, 0),
                    'step2':
                    uu.CreateStatsWithPassFails(4, 0)
                }),
            }),
            data_types.Expectation('foo', ['semistale'], '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', ['active'], 'Failure'):
            data_types.BuilderStepMap({
                'foo_builder':
                data_types.StepBuildStatsMap({
                    'step1':
                    uu.CreateStatsWithPassFails(1, 1),
                    'step2':
                    uu.CreateStatsWithPassFails(2, 2),
                }),
                'bar_builder':
                data_types.StepBuildStatsMap({
                    'step1':
                    uu.CreateStatsWithPassFails(3, 3),
                    'step2':
                    uu.CreateStatsWithPassFails(0, 4)
                }),
            }),
        }),
    })
    expected_stale = {
        'foo': {
            data_types.Expectation('foo', ['stale'], 'Failure'): {
                'foo_builder': {
                    'step1': uu.CreateStatsWithPassFails(1, 0),
                    'step2': uu.CreateStatsWithPassFails(2, 0),
                },
                'bar_builder': {
                    'step1': uu.CreateStatsWithPassFails(3, 0),
                    'step2': uu.CreateStatsWithPassFails(4, 0)
                },
            },
        },
    }
    expected_semi_stale = {
        'foo': {
            data_types.Expectation('foo', ['semistale'], 'Failure'): {
                'foo_builder': {
                    'step1': uu.CreateStatsWithPassFails(1, 0),
                    'step2': uu.CreateStatsWithPassFails(2, 2),
                },
                'bar_builder': {
                    'step1': uu.CreateStatsWithPassFails(3, 0),
                    'step2': uu.CreateStatsWithPassFails(0, 4)
                },
            },
        },
    }
    expected_active = {
        'foo': {
            data_types.Expectation('foo', ['active'], 'Failure'): {
                'foo_builder': {
                    'step1': uu.CreateStatsWithPassFails(1, 1),
                    'step2': uu.CreateStatsWithPassFails(2, 2),
                },
                'bar_builder': {
                    'step1': uu.CreateStatsWithPassFails(3, 3),
                    'step2': uu.CreateStatsWithPassFails(0, 4)
                },
            },
        },
    }
    stale_dict, semi_stale_dict, active_dict =\
        expectation_map.SplitByStaleness()
    self.assertEqual(stale_dict, expected_stale)
    self.assertEqual(semi_stale_dict, expected_semi_stale)
    self.assertEqual(active_dict, expected_active)
def testAllExpectations ( self ) : expectation_map = data_types . TestExpectationMap ( { 'foo' : data_types . ExpectationBuilderMap ( { data_types . Expectation ( 'foo' , [ 'stale' ] , 'Failure' ) : data_types . BuilderStepMap ( { 'foo_builder' : data_types . StepBuildStatsMap ( { 'step1' : uu . CreateStatsWithPassFails ( 1 , 0 ) , 'step2' : uu . CreateStatsWithPassFails ( 2 , 0 ) , } ) , 'bar_builder' : data_types . StepBuildStatsMap ( { 'step1' : uu . CreateStatsWithPassFails ( 3 , 0 ) , 'step2' : uu . CreateStatsWithPassFails ( 4 , 0 ) } ) , } ) , data_types . Expectation ( 'foo' , [ 'semistale' ] , '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' , [ 'active' ] , 'Failure' ) : data_types . BuilderStepMap ( { 'foo_builder' : data_types . StepBuildStatsMap ( { 'step1' : uu . CreateStatsWithPassFails ( 1 , 1 ) , 'step2' : uu . CreateStatsWithPassFails ( 2 , 2 ) , } ) , 'bar_builder' : data_types . StepBuildStatsMap ( { 'step1' : uu . CreateStatsWithPassFails ( 3 , 3 ) , 'step2' : uu . CreateStatsWithPassFails ( 0 , 4 ) } ) , } ) , } ) , } ) expected_stale = { 'foo' : { data_types . Expectation ( 'foo' , [ 'stale' ] , 'Failure' ) : { 'foo_builder' : { 'step1' : uu . CreateStatsWithPassFails ( 1 , 0 ) , 'step2' : uu . CreateStatsWithPassFails ( 2 , 0 ) , } , 'bar_builder' : { 'step1' : uu . CreateStatsWithPassFails ( 3 , 0 ) , 'step2' : uu . CreateStatsWithPassFails ( 4 , 0 ) } , } , } , } expected_semi_stale = { 'foo' : { data_types . Expectation ( 'foo' , [ 'semistale' ] , 'Failure' ) : { 'foo_builder' : { 'step1' : uu . CreateStatsWithPassFails ( 1 , 0 ) , 'step2' : uu . CreateStatsWithPassFails ( 2 , 2 ) , } , 'bar_builder' : { 'step1' : uu . CreateStatsWithPassFails ( 3 , 0 ) , 'step2' : uu . CreateStatsWithPassFails ( 0 , 4 ) } , } , } , } expected_active = { 'foo' : { data_types . Expectation ( 'foo' , [ 'active' ] , 'Failure' ) : { 'foo_builder' : { 'step1' : uu . CreateStatsWithPassFails ( 1 , 1 ) , 'step2' : uu . CreateStatsWithPassFails ( 2 , 2 ) , } , 'bar_builder' : { 'step1' : uu . CreateStatsWithPassFails ( 3 , 3 ) , 'step2' : uu . CreateStatsWithPassFails ( 0 , 4 ) } , } , } , } stale_dict , semi_stale_dict , active_dict = expectation_map . SplitByStaleness ( ) self . assertEqual ( stale_dict , expected_stale ) self . assertEqual ( semi_stale_dict , expected_semi_stale ) self . assertEqual ( active_dict , expected_active )
Tests output when all three types of expectations are provided.
Tests output when all three types of expectations are provided .
"""Tests output when all three types of expectations are provided."""
self