mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Test for result of callback with a callable
In this case the callback should get called immediately (no wait) so it is safe to test for this callback, albeit slightly implementation-defined. Contributes to issue CURA-8539.
This commit is contained in:
parent
30d19844f2
commit
9dd251975d
1 changed files with 6 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
from datetime import datetime
|
||||
from unittest.mock import MagicMock, patch
|
||||
from unittest.mock import MagicMock, Mock, patch
|
||||
|
||||
import requests
|
||||
|
||||
|
@ -53,7 +53,11 @@ def test_cleanAuthService() -> None:
|
|||
# Ensure that when setting up an AuthorizationService, no data is set.
|
||||
authorization_service = AuthorizationService(OAUTH_SETTINGS, Preferences())
|
||||
authorization_service.initialize()
|
||||
assert authorization_service.getUserProfile() is None
|
||||
|
||||
mock_callback = Mock()
|
||||
authorization_service.getUserProfile(mock_callback)
|
||||
mock_callback.assert_called_once_with(None)
|
||||
|
||||
assert authorization_service.getAccessToken() is None
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue