"""Tests for the Sentry Connector.""" from unittest.mock import MagicMock, patch from carveouts.connectors import sentry @patch("sentry_sdk.init") def test_sentry_init_sentry_enabled(init_sentry_mock: MagicMock) -> None: """Test sentry.sentry_client is set up when config.SENTRY is set.""" sentry.init_sentry("SENTRY") init_sentry_mock.assert_called() @patch("sentry_sdk.init") def test_sentry_init_sentry_disabled(init_sentry_mock: MagicMock) -> None: """Test sentry.sentry_client is set up when config.SENTRY is NOT set.""" sentry.init_sentry("") init_sentry_mock.assert_not_called()