mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-17 03:37:48 -06:00
Fix some tests not cleaning up correctly after themselves
The PrintInformation test wasn't cleaning up after itself correclty. This left some stuff behind that the other tests were using. Since this is bad (as at that point tests can influence other tests), i've fixed that
This commit is contained in:
parent
04125d4608
commit
0862fd493e
6 changed files with 37 additions and 26 deletions
|
@ -1,4 +1,4 @@
|
|||
from unittest.mock import MagicMock
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
|
@ -14,6 +14,7 @@ def user_profile():
|
|||
result.user_id = "user_id!"
|
||||
return result
|
||||
|
||||
|
||||
def test_login():
|
||||
account = Account(MagicMock())
|
||||
mocked_auth_service = MagicMock()
|
||||
|
@ -55,8 +56,8 @@ def test_logout():
|
|||
account.logout()
|
||||
mocked_auth_service.deleteAuthData.assert_called_once_with()
|
||||
|
||||
|
||||
def test_errorLoginState():
|
||||
@patch("UM.Application.Application.getInstance")
|
||||
def test_errorLoginState(application):
|
||||
account = Account(MagicMock())
|
||||
mocked_auth_service = MagicMock()
|
||||
account._authorization_service = mocked_auth_service
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue