-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from wakscord/add-testcode-20230801
Alarm sender 위주로 테스트 코드 추가 및 리팩토링
- Loading branch information
Showing
30 changed files
with
563 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,33 @@ | ||
from enum import Enum | ||
|
||
from app.common.exceptions import AppException | ||
|
||
|
||
class ParseInvalidArgumentException(AppException): | ||
class AlarmSendFailedException(AppException): | ||
def __init__(self, message: str): | ||
self.message = message | ||
|
||
def __str__(self) -> str: | ||
return f"올바른 요청 인자가 아닙니다, ({self.message})" | ||
|
||
return f"요청이 실패했습니다, ({self.message})" | ||
|
||
class ParseInvalidFormatException(AppException): | ||
def __init__(self, message: str): | ||
self.message = message | ||
|
||
class RateLimitException(AppException): | ||
def __str__(self) -> str: | ||
return f"올바른 요청 형식이 아닙니다, ({self.message})" | ||
return "너무 많은 요청을 보내서 요청이 실패했습니다." | ||
|
||
|
||
class AlarmSendFailedException(AppException): | ||
def __init__(self, message: str): | ||
self.message = message | ||
class UnsubscriberException(AppException): | ||
def __init__(self, unsubscriber: str | None): | ||
self.unsubscriber = unsubscriber | ||
|
||
def __str__(self) -> str: | ||
return f"요청이 실패했습니다, ({self.message})" | ||
return f"구독을 해지한 유저 입니다, (key: {self.unsubscriber})" | ||
|
||
|
||
class RateLimitException(AppException): | ||
def __str__(self) -> str: | ||
return "너무 많은 요청을 보내서 요청이 실패했습니다." | ||
class RequestExc(Enum): | ||
UNKNOWN = "전송에 실패했습니다" | ||
AIOHTTP_CLIENT_CONN_ERROR = "클라이언트 커넥션 에러가 발생했습니다" | ||
|
||
@staticmethod | ||
def get_message(exc: "RequestExc") -> str: | ||
return exc.value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from app.common.exceptions import AppException | ||
|
||
|
||
class ParseInvalidArgumentException(AppException): | ||
def __init__(self, message: str): | ||
self.message = message | ||
|
||
def __str__(self) -> str: | ||
return f"올바른 요청 인자가 아닙니다, ({self.message})" | ||
|
||
|
||
class ParseInvalidFormatException(AppException): | ||
def __init__(self, message: str): | ||
self.message = message | ||
|
||
def __str__(self) -> str: | ||
return f"올바른 요청 형식이 아닙니다, ({self.message})" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.