Fix Client.mark_as_(un)read, and add tests
This commit is contained in:
@@ -17,12 +17,33 @@ def session(pytestconfig):
|
||||
|
||||
pytestconfig.cache.set("session_cookies", session.get_cookies())
|
||||
|
||||
# TODO: Allow the main session object to be closed - and perhaps used in `with`?
|
||||
session._session.close()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def client(session):
|
||||
return fbchat.Client(session=session)
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def user(pytestconfig, session):
|
||||
user_id = pytestconfig.cache.get("user_id", None)
|
||||
if not user_id:
|
||||
user_id = input("A user you're chatting with's id: ")
|
||||
pytestconfig.cache.set("user_id", user_id)
|
||||
return fbchat.User(session=session, id=user_id)
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def group(pytestconfig, session):
|
||||
group_id = pytestconfig.cache.get("group_id", None)
|
||||
if not group_id:
|
||||
group_id = input("A group you're chatting with's id: ")
|
||||
pytestconfig.cache.set("group_id", group_id)
|
||||
return fbchat.Group(session=session, id=group_id)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def listener(session):
|
||||
return fbchat.Listener(session=session, chat_on=False, foreground=False)
|
||||
|
Reference in New Issue
Block a user