Add page test

This commit is contained in:
Mads Marquart
2019-10-23 12:55:20 +02:00
parent 0c305f621a
commit 5019aac6b7

20
tests/test_page.py Normal file
View File

@@ -0,0 +1,20 @@
from fbchat._page import Page
def test_page_from_graphql():
data = {
"id": "123456",
"name": "Some school",
"profile_picture": {"uri": "https://scontent-arn2-1.xx.fbcdn.net/v/..."},
"url": "https://www.facebook.com/some-school/",
"category_type": "SCHOOL",
"city": None,
}
assert Page(
uid="123456",
photo="https://scontent-arn2-1.xx.fbcdn.net/v/...",
name="Some school",
url="https://www.facebook.com/some-school/",
city=None,
category="SCHOOL",
) == Page._from_graphql(data)