Refactor code for improved readability and consistency
CI / lint-test-build (push) Successful in 54s
CI / lint-test-build (push) Successful in 54s
- Cleaned up multiline statements and removed unnecessary line breaks in various files. - Ensured consistent formatting in function definitions and calls across the codebase. - Updated docstrings and comments for clarity where applicable. - Removed trailing newlines in module docstrings. - Enhanced logging statements for better clarity in maintenance tasks.
This commit is contained in:
@@ -63,8 +63,7 @@ async def test_configuration_service_set_setting(mock_settings, mock_store, mock
|
||||
|
||||
mock_created_setting = Mock()
|
||||
mock_created_setting.updated_at = "2023-01-01T00:00:00"
|
||||
mock_repo_instance.create_setting = AsyncMock(
|
||||
return_value=mock_created_setting)
|
||||
mock_repo_instance.create_setting = AsyncMock(return_value=mock_created_setting)
|
||||
mock_repo_instance.get_setting = AsyncMock(return_value=None)
|
||||
|
||||
await service.set_setting("test_key", "test_value", "test_user")
|
||||
@@ -73,7 +72,9 @@ async def test_configuration_service_set_setting(mock_settings, mock_store, mock
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_configuration_service_hot_reload_detection(mock_settings, mock_store, mock_audit_repo):
|
||||
async def test_configuration_service_hot_reload_detection(
|
||||
mock_settings, mock_store, mock_audit_repo
|
||||
):
|
||||
"""Test hot-reload detection functionality."""
|
||||
service = ConfigurationService(mock_settings, mock_store, mock_audit_repo)
|
||||
|
||||
@@ -86,8 +87,7 @@ async def test_configuration_service_hot_reload_detection(mock_settings, mock_st
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
mock_repo_instance.get_latest_updated_at = AsyncMock(
|
||||
return_value=datetime.now())
|
||||
mock_repo_instance.get_latest_updated_at = AsyncMock(return_value=datetime.now())
|
||||
assert await service.is_config_outdated() is True
|
||||
|
||||
|
||||
@@ -105,8 +105,7 @@ async def test_configuration_service_reload_if_changed(mock_settings, mock_store
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
mock_repo_instance.get_latest_updated_at = AsyncMock(
|
||||
return_value=datetime.now())
|
||||
mock_repo_instance.get_latest_updated_at = AsyncMock(return_value=datetime.now())
|
||||
|
||||
result = await service.reload_if_changed()
|
||||
assert result is True
|
||||
@@ -125,8 +124,7 @@ async def test_configuration_service_get_config_version(mock_settings, mock_stor
|
||||
|
||||
mock_created_setting = Mock()
|
||||
mock_created_setting.updated_at = "2023-01-01T00:00:00"
|
||||
mock_repo_instance.create_setting = AsyncMock(
|
||||
return_value=mock_created_setting)
|
||||
mock_repo_instance.create_setting = AsyncMock(return_value=mock_created_setting)
|
||||
mock_repo_instance.get_setting = AsyncMock(return_value=None)
|
||||
|
||||
await service.set_setting("test_key", "test_value", "test_user")
|
||||
@@ -134,7 +132,9 @@ async def test_configuration_service_get_config_version(mock_settings, mock_stor
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_configuration_service_get_last_updated_at(mock_settings, mock_store, mock_audit_repo):
|
||||
async def test_configuration_service_get_last_updated_at(
|
||||
mock_settings, mock_store, mock_audit_repo
|
||||
):
|
||||
"""Test getting last updated timestamp."""
|
||||
service = ConfigurationService(mock_settings, mock_store, mock_audit_repo)
|
||||
assert service.get_last_updated_at() is None
|
||||
@@ -145,8 +145,7 @@ async def test_configuration_service_get_last_updated_at(mock_settings, mock_sto
|
||||
|
||||
mock_created_setting = Mock()
|
||||
mock_created_setting.updated_at = "2023-01-01T00:00:00"
|
||||
mock_repo_instance.create_setting = AsyncMock(
|
||||
return_value=mock_created_setting)
|
||||
mock_repo_instance.create_setting = AsyncMock(return_value=mock_created_setting)
|
||||
mock_repo_instance.get_setting = AsyncMock(return_value=None)
|
||||
|
||||
await service.set_setting("test_key", "test_value", "test_user")
|
||||
|
||||
Reference in New Issue
Block a user