def test_feedback_dialog(window): def screenshot_dialog(): screenshot(dialog, name="feedback_dialog") dialog.close() reported_error = ReportedError('type', 'text', {}) sentry_reporter = SentryReporter() dialog = FeedbackDialog(window, sentry_reporter, reported_error, "1.2.3", 23) dialog.closeEvent = lambda _: None # Otherwise, the application will stop QTimer.singleShot(1000, screenshot_dialog) dialog.exec_()
def test_feedback_dialog_report_sent(window): def screenshot_dialog(): screenshot(dialog, name="feedback_dialog") dialog.close() def on_report_sent(): on_report_sent.did_send_report = True on_report_sent.did_send_report = False reported_error = ReportedError( '', 'Tribler GUI Test to test sending crash report works', {}) sentry_reporter = SentryReporter() dialog = FeedbackDialog(window, sentry_reporter, reported_error, "1.2.3", 23) dialog.closeEvent = lambda _: None # Otherwise, the application will stop dialog.on_report_sent = on_report_sent QTest.mouseClick(dialog.send_report_button, Qt.LeftButton) QTimer.singleShot(1000, screenshot_dialog) dialog.exec_() assert on_report_sent.did_send_report
""" This package contains the code for the GUI, written in pyQt. """ from tribler_common.sentry_reporter.sentry_reporter import SentryReporter gui_sentry_reporter = SentryReporter()
def __init__(self): self.logger = logging.getLogger("CoreExceptionHandler") self.report_callback: Optional[Callable[[ReportedError], None]] = None self.unreported_error: Optional[ReportedError] = None self.sentry_reporter = SentryReporter()
def sentry_reporter(): return SentryReporter()