def test_transport_option(monkeypatch): dsn = "https://[email protected]/123" dsn2 = "https://[email protected]/124" assert str(Client(dsn=dsn).dsn) == dsn assert Client().dsn is None monkeypatch.setenv("SENTRY_DSN", dsn) transport = Transport({"dsn": dsn2}) assert text_type(transport.parsed_dsn) == dsn2 assert str(Client(transport=transport).dsn) == dsn
def __init__( self, options # type: Dict[str, Any] ): # type: (...) -> None from sentry_sdk.consts import VERSION Transport.__init__(self, options) assert self.parsed_dsn is not None self._worker = BackgroundWorker() self._auth = self.parsed_dsn.to_auth("sentry.python/%s" % VERSION) self.options = options self._sqs_queue_url = options.get('sqs_queue_url') if not self._sqs_queue_url: self._sqs_queue_url = os.environ.get('SENTRY_SQS_QUEUE_URL') self._sqs_client_kwargs = options['sqs_client_kwargs'] from sentry_sdk import Hub self.hub_cls = Hub
def __init__(self, capture_event_callback): Transport.__init__(self) self.capture_event = capture_event_callback self._queue = None