def test_apply_patch(self): checkout = self._make_checkout() checkout._executive = MockExecutive(should_log=True) checkout._scm.script_path = lambda script: script mock_patch = Mock() mock_patch.contents = lambda: "foo" mock_patch.reviewer = lambda: None expected_logs = "MOCK run_command: ['svn-apply', '--force'], cwd=/mock-checkout, input=foo\n" OutputCapture().assert_outputs(self, checkout.apply_patch, [mock_patch], expected_logs=expected_logs)
def test_apply_patch(self): checkout = self._make_checkout() checkout._executive = MockExecutive(should_log=True) checkout._scm.script_path = lambda script: script mock_patch = Mock() mock_patch.contents = lambda: "foo" mock_patch.reviewer = lambda: None expected_stderr = "MOCK run_command: ['svn-apply', '--force'], cwd=/mock-checkout\n" OutputCapture().assert_outputs(self, checkout.apply_patch, [mock_patch], expected_stderr=expected_stderr)
def test_apply_patch(self): checkout = self._make_checkout() checkout._executive = MockExecutive(should_log=True) checkout.script_path = lambda script: script mock_patch = Mock() mock_patch.contents = lambda: "foo" mock_patch.reviewer = lambda: None with OutputCapture(level=logging.INFO) as captured: checkout.apply_patch(mock_patch) self.assertEqual( captured.root.log.getvalue(), "MOCK run_command: ['svn-apply', '--force'], cwd=/mock-checkout, input=foo\n", )
def test_post_blame_comment_on_bug(self): sheriff = Sheriff(MockTool(), MockSheriffBot()) builders = [ Builder("Foo", None), Builder("Bar", None), ] commit_info = Mock() commit_info.bug_id = lambda: None commit_info.revision = lambda: 4321 commit_info.committer = lambda: None commit_info.committer_email = lambda: "*****@*****.**" commit_info.reviewer = lambda: None commit_info.author = lambda: None sheriff.post_automatic_rollout_patch(commit_info, builders)