Refactor models file structure

This commit is contained in:
Mads Marquart
2020-01-23 14:22:36 +01:00
parent 2aea401c79
commit a1fc235327
28 changed files with 116 additions and 119 deletions

View File

@@ -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():

View File

@@ -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():

View File

@@ -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():

View File

@@ -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(

View File

@@ -1,5 +1,5 @@
import datetime
from fbchat._plan import GuestStatus, PlanData
from fbchat import GuestStatus, PlanData
def test_plan_properties(session):

View File

@@ -1,4 +1,4 @@
from fbchat._poll import Poll, PollOption
from fbchat import Poll, PollOption
def test_poll_option_from_graphql_unvoted():

View File

@@ -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():

View File

@@ -1,6 +1,6 @@
import pytest
import fbchat
from fbchat._sticker import Sticker
from fbchat import Sticker
def test_from_graphql_none():