mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-11 08:47:50 -06: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
1 changed files with 24 additions and 22 deletions
|
@ -93,6 +93,7 @@ def test_sync_success():
|
||||||
service1 = "test_service1"
|
service1 = "test_service1"
|
||||||
service2 = "test_service2"
|
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)
|
account.setSyncState(service1, SyncState.SYNCING)
|
||||||
assert account.syncState == SyncState.SYNCING
|
assert account.syncState == SyncState.SYNCING
|
||||||
|
|
||||||
|
@ -114,6 +115,7 @@ def test_sync_update_action():
|
||||||
|
|
||||||
mockUpdateCallback = MagicMock()
|
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)
|
account.setSyncState(service1, SyncState.SYNCING)
|
||||||
assert account.syncState == SyncState.SYNCING
|
assert account.syncState == SyncState.SYNCING
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue