SIENTIAPDE-1174
Refactor unit tests to improve readability and maintainability - Updated test assertions and mock setups in test_app.py for clarity. - Added 'pod_id' to the metadata in test_ingestor.py for consistency. - Introduced a new test for TAG_WRITTEN_COUNT in test_metrics.py to verify its definition. - Enhanced test data structure in test_data_manager.py to include additional fields.
This commit is contained in:
@@ -10,6 +10,7 @@ metadata = {
|
||||
"model_name": "test_model",
|
||||
"workflow_name": "test_workflow",
|
||||
"schema_name": "test_schedule",
|
||||
"pod_id": "localhost",
|
||||
},
|
||||
}
|
||||
|
||||
@@ -258,7 +259,10 @@ def test_publish_no_kafka(data_manager):
|
||||
@patch("ingestor.managers.data_manager.traceback")
|
||||
def test_publish_error(traceback, data_manager):
|
||||
topic = "test_topic"
|
||||
data = {"key": "value"}
|
||||
data = {
|
||||
"key": "value",
|
||||
"name": "test_tag"
|
||||
}
|
||||
|
||||
# Mock the send method of the Kafka producer to raise an exception
|
||||
send_mock = MagicMock(side_effect=Exception("Test error"))
|
||||
|
||||
Reference in New Issue
Block a user