def test_patch_not_relevant_bindings(self): self.maxDiff = None mock_options = self._step_options() mock_options.group = "bindings" tool = MockTool(log_executive=True) tool.scm()._mockChangedFiles = ["Source/JavaScriptCore/Makefile", "Source/ChangeLog"] # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment. tool._deprecated_port = DeprecatedPort() step = steps.CheckPatchRelevance(tool, mock_options) expected_logs = """Checking relevance of patch
def test_patch_relevant(self): self.maxDiff = None mock_options = self._step_options() tool = MockTool(log_executive=True) tool.scm()._mockChangedFiles = ["JSTests/MockFile1", "ChangeLog"] # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment. tool._deprecated_port = DeprecatedPort() step = steps.CheckPatchRelevance(tool, mock_options) expected_logs = """Checking relevance of patch """ OutputCapture().assert_outputs(self, step.run, [{}], expected_logs=expected_logs)
def test_patch_not_relevant_jsc(self): self.maxDiff = None mock_options = self._step_options() mock_options.group = "jsc" tool = MockTool(log_executive=True) tool.scm()._mockChangedFiles = ["Tools/ChangeLog", "Tools/Scripts/webkitpy/tool/steps/steps_unittest.py"] # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment. tool._deprecated_port = DeprecatedPort() step = steps.CheckPatchRelevance(tool, mock_options) expected_logs = """Checking relevance of patch This patch does not have relevant changes. """ with self.assertRaises(ScriptError): OutputCapture().assert_outputs(self, step.run, [{}], expected_logs=expected_logs)
def test_patch_relevant(self): self.maxDiff = None mock_options = self._step_options() tool = MockTool(log_executive=True) tool.scm()._mockChangedFiles = ["JSTests/MockFile1", "ChangeLog"] # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment. tool._deprecated_port = DeprecatedPort() step = steps.CheckPatchRelevance(tool, mock_options) with OutputCapture(level=logging.INFO) as captured: step.run({}) self.assertEqual( captured.root.log.getvalue(), 'Checking relevance of patch\n', )
def test_patch_not_relevant_jsc(self): self.maxDiff = None mock_options = self._step_options() mock_options.group = "jsc" tool = MockTool(log_executive=True) tool.scm()._mockChangedFiles = [ "Tools/ChangeLog", "Tools/Scripts/webkitpy/tool/steps/steps_unittest.py" ] # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment. tool._deprecated_port = DeprecatedPort() step = steps.CheckPatchRelevance(tool, mock_options) with self.assertRaises(ScriptError), OutputCapture( level=logging.INFO) as captured: step.run({}) self.assertEqual( captured.root.log.getvalue(), 'Checking relevance of patch\n', )