testing/unexpected_passes_common/data_types_unittest.py
def testUnusedButNotEmpty(self):
    """Tests filtering if there is an unused expectation but no empty tests."""
    expectation_map = data_types.TestExpectationMap({
        'expectation_file':
        data_types.ExpectationBuilderMap({
            data_types.Expectation('foo/test', ['win'], ['Failure']):
            data_types.BuilderStepMap({
                'SomeBuilder':
                data_types.StepBuildStatsMap(),
            }),
            data_types.Expectation('foo/test', ['linux'], ['Failure']):
            data_types.BuilderStepMap(),
        })
    })
    expected_expectation_map = data_types.TestExpectationMap({
        'expectation_file':
        data_types.ExpectationBuilderMap({
            data_types.Expectation('foo/test', ['win'], ['Failure']):
            data_types.BuilderStepMap({
                'SomeBuilder':
                data_types.StepBuildStatsMap(),
            }),
        }),
    })
    expected_unused = {
        'expectation_file':
        [data_types.Expectation('foo/test', ['linux'], ['Failure'])]
    }
    unused_expectations = expectation_map.FilterOutUnusedExpectations()
    self.assertEqual(unused_expectations, expected_unused)
    self.assertEqual(expectation_map, expected_expectation_map)
Tests filtering if there is an unused expectation but no empty tests.
Tests filtering if there is an unused expectation but no empty tests.
Tests filtering if there is an unused expectation but no empty tests .
def testUnusedButNotEmpty(self):
    expectation_map = data_types.TestExpectationMap({
        'expectation_file':
        data_types.ExpectationBuilderMap({
            data_types.Expectation('foo/test', ['win'], ['Failure']):
            data_types.BuilderStepMap({
                'SomeBuilder':
                data_types.StepBuildStatsMap(),
            }),
            data_types.Expectation('foo/test', ['linux'], ['Failure']):
            data_types.BuilderStepMap(),
        })
    })
    expected_expectation_map = data_types.TestExpectationMap({
        'expectation_file':
        data_types.ExpectationBuilderMap({
            data_types.Expectation('foo/test', ['win'], ['Failure']):
            data_types.BuilderStepMap({
                'SomeBuilder':
                data_types.StepBuildStatsMap(),
            }),
        }),
    })
    expected_unused = {
        'expectation_file':
        [data_types.Expectation('foo/test', ['linux'], ['Failure'])]
    }
    unused_expectations = expectation_map.FilterOutUnusedExpectations()
    self.assertEqual(unused_expectations, expected_unused)
    self.assertEqual(expectation_map, expected_expectation_map)
def testUnusedButNotEmpty ( self ) : expectation_map = data_types . TestExpectationMap ( { 'expectation_file' : data_types . ExpectationBuilderMap ( { data_types . Expectation ( 'foo/test' , [ 'win' ] , [ 'Failure' ] ) : data_types . BuilderStepMap ( { 'SomeBuilder' : data_types . StepBuildStatsMap ( ) , } ) , data_types . Expectation ( 'foo/test' , [ 'linux' ] , [ 'Failure' ] ) : data_types . BuilderStepMap ( ) , } ) } ) expected_expectation_map = data_types . TestExpectationMap ( { 'expectation_file' : data_types . ExpectationBuilderMap ( { data_types . Expectation ( 'foo/test' , [ 'win' ] , [ 'Failure' ] ) : data_types . BuilderStepMap ( { 'SomeBuilder' : data_types . StepBuildStatsMap ( ) , } ) , } ) , } ) expected_unused = { 'expectation_file' : [ data_types . Expectation ( 'foo/test' , [ 'linux' ] , [ 'Failure' ] ) ] } unused_expectations = expectation_map . FilterOutUnusedExpectations ( ) self . assertEqual ( unused_expectations , expected_unused ) self . assertEqual ( expectation_map , expected_expectation_map )
Tests filtering if there is an unused expectation but no empty tests.
Tests filtering if there is an unused expectation but no empty tests .
"""Tests filtering if there is an unused expectation but no empty tests."""
self