Skip to content

Commit d3cf4af

Browse files
test
1 parent e96b4c1 commit d3cf4af

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/test_metric.py

+13
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,19 @@ def test_lambda_metric_timestamp_with_extension(self):
5858
"test_timestamp", 1, timestamp=timestamp, tags=[dd_lambda_layer_tag]
5959
)
6060

61+
@patch("datadog_lambda.metric.should_use_extension", True)
62+
def test_lambda_metric_datetime_with_extension(self):
63+
patcher = patch("datadog_lambda.metric.extension_thread_stats")
64+
self.mock_metric_extension_thread_stats = patcher.start()
65+
self.addCleanup(patcher.stop)
66+
67+
delta = timedelta(hours=5)
68+
timestamp = datetime.now() - delta
69+
70+
lambda_metric("test_timestamp", 1, timestamp)
71+
self.mock_metric_lambda_stats.distribution.assert_not_called()
72+
self.mock_metric_extension_thread_stats.distribution.assert_not_called()
73+
6174
@patch("datadog_lambda.metric.should_use_extension", True)
6275
def test_lambda_metric_invalid_timestamp_with_extension(self):
6376
patcher = patch("datadog_lambda.metric.extension_thread_stats")

0 commit comments

Comments
 (0)