Skip to content

Commit

Permalink
refactor: make decorators a folder not a file
Browse files Browse the repository at this point in the history
  • Loading branch information
meetbryce committed Sep 6, 2024
1 parent 7e488bd commit a913476
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion ossai/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from slack_sdk.errors import SlackApiError
from langsmith import Client

from ossai.decorators import catch_errors_dm_user
from ossai.decorators.catch_error_dm_user import catch_errors_dm_user
from ossai.logging_config import logger
from ossai.summarizer import summarize_slack_messages
from ossai.topic_analysis import analyze_topics_of_history
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from unittest.mock import AsyncMock, MagicMock, patch
from slack_sdk import WebClient
from slack_sdk.errors import SlackApiError
from ossai.decorators import catch_errors_dm_user
from ossai.decorators.catch_error_dm_user import catch_errors_dm_user


@pytest.mark.asyncio
Expand Down Expand Up @@ -32,7 +32,7 @@ async def test_catch_errors_dm_user_happy_path():


@pytest.mark.asyncio
@patch("ossai.decorators.logger")
@patch("ossai.decorators.catch_error_dm_user.logger")
async def test_catch_errors_dm_user_error_handling(mock_logger):
# Setup
client = AsyncMock(spec=WebClient)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def test_handler_feedback_very_helpful_button(env_get_mock, client_mock):


@pytest.mark.asyncio
@patch("ossai.decorators.get_direct_message_channel_id")
@patch("ossai.decorators.catch_error_dm_user.get_direct_message_channel_id")
@patch("ossai.utils.get_bot_id")
async def test_handler_shortcuts_channel_not_found_error(
get_bot_id_mock, get_direct_message_channel_id_mock
Expand Down Expand Up @@ -483,7 +483,7 @@ async def test_handler_tldr_since_slash_command_happy_path(


@pytest.mark.asyncio
@patch("ossai.decorators.get_direct_message_channel_id")
@patch("ossai.decorators.catch_error_dm_user.get_direct_message_channel_id")
@patch("ossai.utils.get_bot_id")
async def test_handlers_bot_not_in_channel(
get_bot_id_mock: AsyncMock,
Expand Down

0 comments on commit a913476

Please sign in to comment.