Skip to content

Commit 31d6d24

Browse files
chore: update mocks
1 parent cca0132 commit 31d6d24

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

tests/core/unit/telemetry/test_provider.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import pytest
44
from unittest.mock import patch, MagicMock
55

6+
from opentelemetry.sdk.metrics import Counter
7+
from opentelemetry.sdk.metrics.export import AggregationTemporality
8+
69
from sap_cloud_sdk.core.telemetry._provider import (
710
get_meter,
811
shutdown,
@@ -182,9 +185,10 @@ def test_setup_meter_provider_success(self):
182185

183186
assert result is mock_provider
184187

185-
# Verify exporter was created with endpoint
188+
# Verify exporter was created with endpoint and delta temporality
186189
mock_exporter_class.assert_called_once_with(
187-
endpoint="http://localhost:4317"
190+
endpoint="http://localhost:4317",
191+
preferred_temporality={Counter: AggregationTemporality.DELTA},
188192
)
189193

190194
# Verify reader was created with exporter
@@ -224,5 +228,8 @@ def test_setup_meter_provider_with_valid_config(self):
224228
result = _setup_meter_provider()
225229

226230
assert result is mock_provider
227-
# Verify exporter was created with correct endpoint
228-
mock_exporter.assert_called_with(endpoint=config.otlp_endpoint)
231+
# Verify exporter was created with correct endpoint and delta temporality
232+
mock_exporter.assert_called_with(
233+
endpoint=config.otlp_endpoint,
234+
preferred_temporality={Counter: AggregationTemporality.DELTA},
235+
)

0 commit comments

Comments
 (0)