mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-09-13 06:43:15 +08: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,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…
x
Reference in New Issue
Block a user