Skip to content

Commit a0da0c0

Browse files
committed
fix package aliyun to otel
1 parent ffbd672 commit a0da0c0

File tree

1 file changed

+7
-7
lines changed
  • instrumentation-genai/opentelemetry-instrumentation-dify/tests/instrumentation/dify

1 file changed

+7
-7
lines changed

instrumentation-genai/opentelemetry-instrumentation-dify/tests/instrumentation/dify/test_strategy.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ def setUp(self):
2424
# Initialize the strategy with the mock handler
2525
self.strategy = WorkflowRunStartStrategy(self.mock_handler)
2626

27-
@patch("aliyun.instrumentation.dify.strategy.workflow_strategy.get_workflow_run_id", return_value="test_event_id")
28-
@patch("aliyun.instrumentation.dify.strategy.workflow_strategy.get_timestamp_from_datetime_attr", return_value=1234567890)
27+
@patch("opentelemetry.instrumentation.dify.strategy.workflow_strategy.get_workflow_run_id", return_value="test_event_id")
28+
@patch("opentelemetry.instrumentation.dify.strategy.workflow_strategy.get_timestamp_from_datetime_attr", return_value=1234567890)
2929
def test_handle_workflow_run_start_v1(self, mock_get_timestamp, mock_get_workflow_run_id):
3030
# Mock run object
3131
run = MagicMock()
@@ -58,8 +58,8 @@ def test_handle_workflow_run_start_v1(self, mock_get_timestamp, mock_get_workflo
5858
)
5959
self.mock_handler._logger.warning.assert_not_called()
6060

61-
@patch("aliyun.instrumentation.dify.strategy.workflow_strategy.get_workflow_run_id", return_value="test_event_id")
62-
@patch("aliyun.instrumentation.dify.strategy.workflow_strategy.get_timestamp_from_datetime_attr", return_value=1234567890)
61+
@patch("opentelemetry.instrumentation.dify.strategy.workflow_strategy.get_workflow_run_id", return_value="test_event_id")
62+
@patch("opentelemetry.instrumentation.dify.strategy.workflow_strategy.get_timestamp_from_datetime_attr", return_value=1234567890)
6363
def test_handle_workflow_run_start_v2(self, mock_get_timestamp, mock_get_workflow_run_id):
6464
# Mock run object
6565
run = MagicMock()
@@ -101,7 +101,7 @@ def setUp(self):
101101

102102
self.strategy = WorkflowRunFailedStrategy(self.mock_handler)
103103

104-
@patch("aliyun.instrumentation.dify.strategy.workflow_strategy.get_workflow_run_id", return_value="test_event_id")
104+
@patch("opentelemetry.instrumentation.dify.strategy.workflow_strategy.get_workflow_run_id", return_value="test_event_id")
105105
def test_handle_workflow_run_failed_v1(self, mock_get_workflow_run_id):
106106
run = MagicMock()
107107
run.app_id = "test_app_id"
@@ -114,7 +114,7 @@ def test_handle_workflow_run_failed_v1(self, mock_get_workflow_run_id):
114114
self.mock_handler._logger.warning.assert_not_called()
115115
self.mock_handler._tracer.start_span.assert_not_called()
116116

117-
@patch("aliyun.instrumentation.dify.strategy.workflow_strategy.get_workflow_run_id", return_value="test_event_id")
117+
@patch("opentelemetry.instrumentation.dify.strategy.workflow_strategy.get_workflow_run_id", return_value="test_event_id")
118118
def test_handle_workflow_run_failed_v2(self, mock_get_workflow_run_id):
119119
run = MagicMock()
120120
run.inputs = {"sys.app_id": "test_app_id", "sys.user_id": "test_user", "sys.conversation_id": "test_session"}
@@ -138,7 +138,7 @@ def setUp(self):
138138
# Initialize the strategy with the mock handler
139139
self.strategy = WorkflowNodeStartStrategy(self.mock_handler)
140140

141-
@patch("aliyun.instrumentation.dify.strategy.workflow_strategy.get_timestamp_from_datetime_attr", return_value=1234567890)
141+
@patch("opentelemetry.instrumentation.dify.strategy.workflow_strategy.get_timestamp_from_datetime_attr", return_value=1234567890)
142142
def test_workflow_node_start_to_stream_response(self, mock_get_timestamp):
143143
# Mock event object
144144
event = MagicMock()

0 commit comments

Comments
 (0)