test: add agent test coverage and standardize test suite (#2051)

- Add 104 comprehensive tests for agent system
- Integrate agent tests into CI/CD pipeline
- Standardize tests with @pytest.mark.unit markers
- Fix cross-platform path compatibility
- Clean up unused imports and dependencies
This commit is contained in:
Siddhant Rai
2025-10-13 17:13:35 +05:30
committed by GitHub
parent 1805292528
commit d6c49bdbf0
24 changed files with 2775 additions and 501 deletions

View File

@@ -1,21 +1,21 @@
from unittest.mock import patch
from application.core.settings import settings
import pytest
from application.celery_init import make_celery
from application.core.settings import settings
@patch('application.celery_init.Celery')
@pytest.mark.unit
@patch("application.celery_init.Celery")
def test_make_celery(mock_celery):
# Arrange
app_name = 'test_app_name'
app_name = "test_app_name"
# Act
celery = make_celery(app_name)
# Assert
mock_celery.assert_called_once_with(
app_name,
broker=settings.CELERY_BROKER_URL,
backend=settings.CELERY_RESULT_BACKEND
app_name,
broker=settings.CELERY_BROKER_URL,
backend=settings.CELERY_RESULT_BACKEND,
)
celery.conf.update.assert_called_once_with(settings)
assert celery == mock_celery.return_value
assert celery == mock_celery.return_value