mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 03:09:04 +08:00
Mock HttpRequestManager while changing sync state
This change triggers a cascade of updates and in some cases triggers a sync. The sync trigger also triggers an update of the account permissions which crashes because the HttpRequestManager can't be started on a thread. We shouldn't make HTTP requests from our tests anyway so mock this away. Contributes to issue CURA-9220.
This commit is contained in:
parent
d52be42e01
commit
37a98cbb6f
@ -93,6 +93,7 @@ def test_sync_success():
|
||||
service1 = "test_service1"
|
||||
service2 = "test_service2"
|
||||
|
||||
with patch("UM.TaskManagement.HttpRequestManager.HttpRequestManager.getInstance"): # Don't want triggers for account information to actually make HTTP requests.
|
||||
account.setSyncState(service1, SyncState.SYNCING)
|
||||
assert account.syncState == SyncState.SYNCING
|
||||
|
||||
@ -114,6 +115,7 @@ def test_sync_update_action():
|
||||
|
||||
mockUpdateCallback = MagicMock()
|
||||
|
||||
with patch("UM.TaskManagement.HttpRequestManager.HttpRequestManager.getInstance"): # Don't want triggers for account information to actually make HTTP requests.
|
||||
account.setSyncState(service1, SyncState.SYNCING)
|
||||
assert account.syncState == SyncState.SYNCING
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user