Fix unit tests

This commit is contained in:
Erwan MATHIEU 2024-09-26 09:12:40 +02:00
parent 3199437403
commit 57cd7a99a0
3 changed files with 30 additions and 20 deletions

View file

@ -80,12 +80,12 @@ def test_errorLoginState(application):
with patch("UM.TaskManagement.HttpRequestManager.HttpRequestManager.getInstance"): # Don't want triggers for account information to actually make HTTP requests.
account._onLoginStateChanged(True, "BLARG!")
# Even though we said that the login worked, it had an error message, so the login failed.
account.loginStateChanged.emit.called_with(False)
account.loginStateChanged.emit.assert_called_with(False)
with patch("UM.TaskManagement.HttpRequestManager.HttpRequestManager.getInstance"):
account._onLoginStateChanged(True)
account._onLoginStateChanged(False, "OMGZOMG!")
account.loginStateChanged.emit.called_with(False)
account.loginStateChanged.emit.assert_called_with(False)
def test_sync_success():
account = Account(MagicMock())