Skip to content

Commit 02dd919

Browse files
committed
fix: fix OTLP exporter happy-path test
1 parent d12515a commit 02dd919

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tests/unit/test_observability.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,12 +417,19 @@ def test_create_otlp_exporter_returns_exporter_when_cert_present(
417417
"solnlib.observability.grpc.ssl_channel_credentials",
418418
MagicMock(return_value=MagicMock()),
419419
)
420+
mock_exporter = MagicMock()
420421
monkeypatch.setattr(
421422
"solnlib.observability.OTLPMetricExporter",
422-
MagicMock(return_value=MagicMock()),
423+
MagicMock(return_value=mock_exporter),
424+
)
425+
# Build svc without patching _create_otlp_exporter so the real method is called
426+
svc = ObservabilityService(
427+
modinput_type="test-input",
428+
logger=logger,
429+
ta_name="my_ta",
430+
ta_version="1.0.0",
423431
)
424-
svc = _make_service(logger, monkeypatch)
425432
# Act
426433
result = ObservabilityService._create_otlp_exporter(svc)
427434
# Assert
428-
assert result is not None
435+
assert result is mock_exporter

0 commit comments

Comments
 (0)