def test_add_cc_to_bug(self): bugzilla = Bugzilla() bugzilla.browser = MockBrowser() bugzilla.authenticate = lambda: None expected_logs = "Adding ['*****@*****.**'] to the CC list for bug 42\n" OutputCapture().assert_outputs(self, bugzilla.add_cc_to_bug, [42, ["*****@*****.**"]], expected_logs=expected_logs)
def test_add_cc_to_bug(self): bugzilla = Bugzilla() bugzilla.browser = MockBrowser() bugzilla.authenticate = lambda: None with OutputCapture(level=logging.INFO) as captured: bugzilla.add_cc_to_bug(42, ['*****@*****.**']) self.assertEqual( captured.root.log.getvalue(), "Adding ['*****@*****.**'] to the CC list for bug 42\n")
def _assert_reopen(self, item_names=None, selected_index=None, extra_logs=None): bugzilla = Bugzilla() bugzilla.browser = MockBrowser() bugzilla.authenticate = lambda: None mock_find_control = self._mock_find_control(item_names, selected_index) bugzilla.browser.find_control = mock_find_control expected_logs = "Re-opening bug 42\n['comment']\n" if extra_logs: expected_logs += extra_logs OutputCapture().assert_outputs(self, bugzilla.reopen_bug, [42, ["comment"]], expected_logs=expected_logs)
def _assert_reopen(self, item_names=None, selected_index=None, extra_logs=None): bugzilla = Bugzilla() bugzilla.browser = MockBrowser() bugzilla.authenticate = lambda: None mock_find_control = self._mock_find_control(item_names, selected_index) bugzilla.browser.find_control = mock_find_control with OutputCapture(level=logging.INFO) as captured: bugzilla.reopen_bug(42, ['comment']) self.assertEqual( captured.root.log.getvalue(), "Re-opening bug 42\n['comment']\n" + (extra_logs or ''))