testing/unexpected_passes_common/data_types_unittest.py
def testResultMatchSpecificExpectationFiles(self):
    """Tests that a match can be found when specifying expectation files."""
    r = data_types.Result('some/test/case', ['win'], 'Pass', 'pixel_tests',
                          'build_id')
    e = data_types.Expectation('some/test/case', ['win'], 'Failure')
    expectation_map = data_types.TestExpectationMap({
        'foo_expectations':
        data_types.ExpectationBuilderMap({e: data_types.BuilderStepMap()}),
        'bar_expectations':
        data_types.ExpectationBuilderMap({e: data_types.BuilderStepMap()}),
    })
    grouped_results = {
        'some/test/case': [r],
    }
    matched_results = expectation_map._AddGroupedResults(
        grouped_results, 'builder', ['bar_expectations'])
    self.assertEqual(matched_results, set([r]))
    stats = data_types.BuildStats()
    stats.AddPassedBuild()
    expected_expectation_map = {
        'foo_expectations': {
            e: {},
        },
        'bar_expectations': {
            e: {
                'builder': {
                    'pixel_tests': stats,
                }
            }
        }
    }
    self.assertEqual(expectation_map, expected_expectation_map)
Tests that a match can be found when specifying expectation files.
Tests that a match can be found when specifying expectation files.
Tests that a match can be found when specifying expectation files .
def testResultMatchSpecificExpectationFiles(self):
    r = data_types.Result('some/test/case', ['win'], 'Pass', 'pixel_tests',
                          'build_id')
    e = data_types.Expectation('some/test/case', ['win'], 'Failure')
    expectation_map = data_types.TestExpectationMap({
        'foo_expectations':
        data_types.ExpectationBuilderMap({e: data_types.BuilderStepMap()}),
        'bar_expectations':
        data_types.ExpectationBuilderMap({e: data_types.BuilderStepMap()}),
    })
    grouped_results = {
        'some/test/case': [r],
    }
    matched_results = expectation_map._AddGroupedResults(
        grouped_results, 'builder', ['bar_expectations'])
    self.assertEqual(matched_results, set([r]))
    stats = data_types.BuildStats()
    stats.AddPassedBuild()
    expected_expectation_map = {
        'foo_expectations': {
            e: {},
        },
        'bar_expectations': {
            e: {
                'builder': {
                    'pixel_tests': stats,
                }
            }
        }
    }
    self.assertEqual(expectation_map, expected_expectation_map)
def testResultMatchSpecificExpectationFiles ( self ) : r = data_types . Result ( 'some/test/case' , [ 'win' ] , 'Pass' , 'pixel_tests' , 'build_id' ) e = data_types . Expectation ( 'some/test/case' , [ 'win' ] , 'Failure' ) expectation_map = data_types . TestExpectationMap ( { 'foo_expectations' : data_types . ExpectationBuilderMap ( { e : data_types . BuilderStepMap ( ) } ) , 'bar_expectations' : data_types . ExpectationBuilderMap ( { e : data_types . BuilderStepMap ( ) } ) , } ) grouped_results = { 'some/test/case' : [ r ] , } matched_results = expectation_map . _AddGroupedResults ( grouped_results , 'builder' , [ 'bar_expectations' ] ) self . assertEqual ( matched_results , set ( [ r ] ) ) stats = data_types . BuildStats ( ) stats . AddPassedBuild ( ) expected_expectation_map = { 'foo_expectations' : { e : { } , } , 'bar_expectations' : { e : { 'builder' : { 'pixel_tests' : stats , } } } } self . assertEqual ( expectation_map , expected_expectation_map )
Tests that a match can be found when specifying expectation files.
Tests that a match can be found when specifying expectation files .
"""Tests that a match can be found when specifying expectation files."""
self