-
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.
Remove Pydantic from dependency (#91)
- Loading branch information
1 parent
a3b03f8
commit e7d9e13
Showing
9 changed files
with
316 additions
and
358 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,27 @@ | ||
# TODO(lasuillard): Test data models | ||
import pytest | ||
|
||
from django_slack_tools.utils.slack.message import MessageBody, MessageHeader | ||
|
||
|
||
class TestMessageHeader: | ||
def test_instance_creation(self) -> None: | ||
assert MessageHeader() | ||
|
||
def test_from_any(self) -> None: | ||
assert MessageHeader.from_any(None) == MessageHeader() | ||
assert MessageHeader.from_any( | ||
{"mrkdwn": "some-markdown"}, | ||
) == MessageHeader(mrkdwn="some-markdown") | ||
with pytest.raises(TypeError, match="Unsupported type <class 'int'>"): | ||
MessageHeader.from_any(-1) # type: ignore[arg-type] | ||
|
||
|
||
class TestMessageBody: | ||
def test_instance_creation(self) -> None: | ||
assert MessageBody(text="some-text") | ||
|
||
def test_from_any(self) -> None: | ||
assert MessageBody.from_any({"text": "some-text"}) == MessageBody(text="some-text") | ||
assert MessageBody.from_any("some-text") == MessageBody(text="some-text") | ||
with pytest.raises(TypeError, match="Unsupported type <class 'int'>"): | ||
MessageBody.from_any(-1) # type: ignore[arg-type] |
Oops, something went wrong.