Remove methods to set the default thread

This has been done to value explicitness over implicitness, and also
since the question of whether thread_id=None is acceptable was dependent
on mutable variables in Client.
This commit is contained in:
Mads Marquart
2019-08-30 17:48:05 +02:00
parent c70a39c568
commit 7c758501fc
3 changed files with 4 additions and 93 deletions

View File

@@ -45,9 +45,11 @@ def client2(pytestconfig):
@pytest.fixture(scope="module")
def client(client1, thread):
client1.setDefaultThread(thread["id"], thread["type"])
# TODO: These are commented out since `setDefaultThread` is removed - But now any
# test that use this fixture is likely broken!
# client1.setDefaultThread(thread["id"], thread["type"])
yield client1
client1.resetDefaultThread()
# client1.resetDefaultThread()
@pytest.fixture(scope="session", params=["client1", "client2"])

View File

@@ -38,13 +38,3 @@ def test_sessions(client1):
Client("no email needed", "no password needed", session_cookies=session)
client1.setSession(session)
assert client1.isLoggedIn()
@pytest.mark.tryfirst
def test_default_thread(client1, thread):
client1.setDefaultThread(thread["id"], thread["type"])
assert client1.send(Message(text="Sent to the specified thread"))
client1.resetDefaultThread()
with pytest.raises(ValueError):
client1.send(Message(text="Should not be sent"))