def check(self, expectations, overrides, skips, lint=False): port = MockHost().port_factory.get('mac') port._filesystem.write_text_file( port._filesystem.join(port.layout_tests_dir(), 'failures/expected/text.html'), 'foo') expectations_dict = OrderedDict() expectations_dict['expectations'] = expectations if overrides: expectations_dict['overrides'] = overrides port.expectations_dict = lambda: expectations_dict port.skipped_layout_tests = lambda tests: set(skips) expectations_to_lint = expectations_dict if lint else None exp = TestExpectations(port, ['failures/expected/text.html'], expectations_to_lint=expectations_to_lint) exp.parse_all_expectations() # Check that the expectation is for BUG_DUMMY SKIP : ... [ Pass ] self.assertEqual( exp.model().get_modifiers('failures/expected/text.html'), [ TestExpectationParser.DUMMY_BUG_MODIFIER, TestExpectationParser.SKIP_MODIFIER, TestExpectationParser.WONTFIX_MODIFIER ]) self.assertEqual( exp.model().get_expectations('failures/expected/text.html'), set([PASS]))
def test_skipped_entry_dont_exist(self): port = MockHost().port_factory.get('qt') expectations_dict = OrderedDict() expectations_dict['expectations'] = '' port.expectations_dict = lambda: expectations_dict port.skipped_layout_tests = lambda tests: set(['foo/bar/baz.html']) capture = OutputCapture() capture.capture_output() exp = TestExpectations(port) _, _, logs = capture.restore_output() self.assertEqual('The following test foo/bar/baz.html from the Skipped list doesn\'t exist\n', logs)
def test_skipped_entry_dont_exist(self): port = MockHost().port_factory.get("test-win-xp") expectations_dict = OrderedDict() expectations_dict["expectations"] = "" port.expectations_dict = lambda: expectations_dict port.skipped_layout_tests = lambda tests: set(["foo/bar/baz.html"]) capture = OutputCapture() capture.capture_output() exp = TestExpectations(port) _, _, logs = capture.restore_output() self.assertEqual("The following test foo/bar/baz.html from the Skipped list doesn't exist\n", logs)
def check(self, expectations, overrides, skips, lint=False, expected_results=[WONTFIX, SKIP, FAIL]): port = MockHost().port_factory.get('test-win-xp') port._filesystem.write_text_file(port._filesystem.join(port.layout_tests_dir(), 'failures/expected/text.html'), 'foo') expectations_dict = OrderedDict() expectations_dict['expectations'] = expectations if overrides: expectations_dict['overrides'] = overrides port.expectations_dict = lambda: expectations_dict port.skipped_layout_tests = lambda tests: set(skips) expectations_to_lint = expectations_dict if lint else None exp = TestExpectations(port, ['failures/expected/text.html'], expectations_dict=expectations_to_lint, is_lint_mode=lint) self.assertEqual(exp.get_expectations('failures/expected/text.html'), set(expected_results))
def check(self, expectations, overrides, skips, lint=False): port = MockHost().port_factory.get('qt') port._filesystem.write_text_file(port._filesystem.join(port.layout_tests_dir(), 'failures/expected/text.html'), 'foo') expectations_dict = OrderedDict() expectations_dict['expectations'] = expectations if overrides: expectations_dict['overrides'] = overrides port.expectations_dict = lambda: expectations_dict port.skipped_layout_tests = lambda tests: set(skips) exp = TestExpectations(port, ['failures/expected/text.html'], lint) # Check that the expectation is for BUG_DUMMY SKIP : ... [ Pass ] self.assertEquals(exp.get_modifiers('failures/expected/text.html'), [TestExpectationParser.DUMMY_BUG_MODIFIER, TestExpectationParser.SKIP_MODIFIER, TestExpectationParser.WONTFIX_MODIFIER]) self.assertEquals(exp.get_expectations('failures/expected/text.html'), set([PASS]))
def test_skipped_entry_dont_exist(self): port = MockHost().port_factory.get('mac') expectations_dict = OrderedDict() expectations_dict['expectations'] = '' port.expectations_dict = lambda **kwargs: expectations_dict port.skipped_layout_tests = lambda tests, **kwargs: { 'foo/bar/baz.html' } with OutputCapture() as captured: exp = TestExpectations(port) exp.parse_all_expectations() self.assertEqual( captured.root.log.getvalue(), 'The following test foo/bar/baz.html from the Skipped list doesn\'t exist\n', )
def check(self, expectations, overrides, skips, lint=False): port = MockHost().port_factory.get("test-win-xp") port._filesystem.write_text_file( port._filesystem.join(port.layout_tests_dir(), "failures/expected/text.html"), "foo" ) expectations_dict = OrderedDict() expectations_dict["expectations"] = expectations if overrides: expectations_dict["overrides"] = overrides port.expectations_dict = lambda: expectations_dict port.skipped_layout_tests = lambda tests: set(skips) expectations_to_lint = expectations_dict if lint else None exp = TestExpectations(port, ["failures/expected/text.html"], expectations_to_lint=expectations_to_lint) # Check that the expectation is for BUG_DUMMY SKIP : ... [ Pass ] self.assertEqual( exp.get_modifiers("failures/expected/text.html"), [ TestExpectationParser.DUMMY_BUG_MODIFIER, TestExpectationParser.SKIP_MODIFIER, TestExpectationParser.WONTFIX_MODIFIER, ], ) self.assertEqual(exp.get_expectations("failures/expected/text.html"), set([PASS]))