Refactor models file structure
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import pytest
|
||||
import datetime
|
||||
import fbchat
|
||||
from fbchat._attachment import UnsentMessage, ShareAttachment
|
||||
from fbchat import UnsentMessage, ShareAttachment
|
||||
from fbchat._models._message import graphql_to_extensible_attachment
|
||||
|
||||
|
||||
def test_parse_unsent_message():
|
||||
@@ -25,9 +26,7 @@ def test_parse_unsent_message():
|
||||
},
|
||||
"genie_attachment": {"genie_message": None},
|
||||
}
|
||||
assert UnsentMessage(
|
||||
id="ee.mid.$xyz"
|
||||
) == fbchat._message.graphql_to_extensible_attachment(data)
|
||||
assert UnsentMessage(id="ee.mid.$xyz") == graphql_to_extensible_attachment(data)
|
||||
|
||||
|
||||
def test_share_from_graphql_minimal():
|
@@ -1,13 +1,7 @@
|
||||
import datetime
|
||||
import fbchat
|
||||
from fbchat._file import (
|
||||
FileAttachment,
|
||||
AudioAttachment,
|
||||
ImageAttachment,
|
||||
VideoAttachment,
|
||||
graphql_to_attachment,
|
||||
graphql_to_subattachment,
|
||||
)
|
||||
from fbchat import FileAttachment, AudioAttachment, ImageAttachment, VideoAttachment
|
||||
from fbchat._models._file import graphql_to_attachment, graphql_to_subattachment
|
||||
|
||||
|
||||
def test_imageattachment_from_list():
|
@@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
import datetime
|
||||
import fbchat
|
||||
from fbchat._location import LocationAttachment, LiveLocationAttachment
|
||||
from fbchat import LocationAttachment, LiveLocationAttachment
|
||||
|
||||
|
||||
def test_location_attachment_from_graphql():
|
@@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
import fbchat
|
||||
from fbchat import EmojiSize, Mention, Message, MessageData
|
||||
from fbchat._message import graphql_to_extensible_attachment
|
||||
from fbchat._models._message import graphql_to_extensible_attachment
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
@@ -1,5 +1,5 @@
|
||||
import datetime
|
||||
from fbchat._plan import GuestStatus, PlanData
|
||||
from fbchat import GuestStatus, PlanData
|
||||
|
||||
|
||||
def test_plan_properties(session):
|
@@ -1,4 +1,4 @@
|
||||
from fbchat._poll import Poll, PollOption
|
||||
from fbchat import Poll, PollOption
|
||||
|
||||
|
||||
def test_poll_option_from_graphql_unvoted():
|
@@ -1,10 +1,10 @@
|
||||
from fbchat._quick_reply import (
|
||||
from fbchat import (
|
||||
QuickReplyText,
|
||||
QuickReplyLocation,
|
||||
QuickReplyPhoneNumber,
|
||||
QuickReplyEmail,
|
||||
graphql_to_quick_reply,
|
||||
)
|
||||
from fbchat._models._quick_reply import graphql_to_quick_reply
|
||||
|
||||
|
||||
def test_parse_minimal():
|
@@ -1,6 +1,6 @@
|
||||
import pytest
|
||||
import fbchat
|
||||
from fbchat._sticker import Sticker
|
||||
from fbchat import Sticker
|
||||
|
||||
|
||||
def test_from_graphql_none():
|
Reference in New Issue
Block a user