def test_get_expectations(self): updater = WPTExpectationsUpdater(self.mock_host()) self.assertEqual( updater.get_expectations({ 'expected': 'FAIL', 'actual': 'PASS' }), {'Pass'}) self.assertEqual( updater.get_expectations({ 'expected': 'FAIL', 'actual': 'TIMEOUT' }), {'Timeout'}) self.assertEqual( updater.get_expectations({ 'expected': 'TIMEOUT', 'actual': 'PASS' }), {'Pass'}) self.assertEqual( updater.get_expectations({ 'expected': 'PASS', 'actual': 'TIMEOUT CRASH FAIL' }), {'Crash', 'Failure', 'Timeout'}) self.assertEqual( updater.get_expectations({ 'expected': 'SLOW CRASH FAIL TIMEOUT', 'actual': 'PASS' }), {'Pass'})
def test_get_expectations(self): updater = WPTExpectationsUpdater(self.mock_host()) self.assertEqual( updater.get_expectations({'expected': 'FAIL', 'actual': 'PASS'}), {'Pass'}) self.assertEqual( updater.get_expectations({'expected': 'FAIL', 'actual': 'TIMEOUT'}), {'Timeout'}) self.assertEqual( updater.get_expectations({'expected': 'TIMEOUT', 'actual': 'PASS'}), {'Pass'}) self.assertEqual( updater.get_expectations({'expected': 'PASS', 'actual': 'TEXT PASS'}), {'Pass', 'Failure'}) self.assertEqual( updater.get_expectations({'expected': 'PASS', 'actual': 'TIMEOUT CRASH TEXT'}), {'Crash', 'Failure', 'Timeout'}) self.assertEqual( updater.get_expectations({'expected': 'SLOW CRASH FAIL TIMEOUT', 'actual': 'PASS'}), {'Pass'}) self.assertEqual( updater.get_expectations({'expected': 'Pass', 'actual': 'IMAGE+TEXT IMAGE IMAGE'}), {'Failure'}) self.assertEqual( updater.get_expectations({'expected': 'Pass', 'actual': 'MISSING'}), {'Skip'}) self.assertEqual( updater.get_expectations({'expected': 'Pass', 'actual': 'TIMEOUT'}, test_name='foo/bar-manual.html'), {'Skip'})
def test_get_expectations(self): updater = WPTExpectationsUpdater(self.mock_host()) # Positional arguments of SimpleTestResult: (expected, actual, bug) self.assertEqual( updater.get_expectations(SimpleTestResult('FAIL', 'PASS', 'bug')), {'Pass'}) self.assertEqual( updater.get_expectations(SimpleTestResult('FAIL', 'TIMEOUT', 'bug')), {'Timeout'}) self.assertEqual( updater.get_expectations(SimpleTestResult('TIMEOUT', 'PASS', 'bug')), {'Pass'}) self.assertEqual( updater.get_expectations( SimpleTestResult('PASS', 'TEXT PASS', 'bug')), {'Pass', 'Failure'}) self.assertEqual( updater.get_expectations( SimpleTestResult('PASS', 'TIMEOUT CRASH TEXT', 'bug')), {'Crash', 'Failure', 'Timeout'}) self.assertEqual( updater.get_expectations( SimpleTestResult('SLOW CRASH FAIL TIMEOUT', 'PASS', 'bug')), {'Pass'}) self.assertEqual( updater.get_expectations( SimpleTestResult('Pass', 'IMAGE+TEXT IMAGE IMAGE', 'bug')), {'Failure'}) self.assertEqual( updater.get_expectations(SimpleTestResult('Pass', 'MISSING', 'bug')), {'Skip'}) self.assertEqual( updater.get_expectations(SimpleTestResult('Pass', 'TIMEOUT', 'bug'), test_name='foo/bar-manual.html'), {'Skip'})