mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-09 07:56:22 -06:00
STAR-322: Mocking the CuraApp
This commit is contained in:
parent
3b367938de
commit
75d7d49349
6 changed files with 238 additions and 73 deletions
|
@ -6,7 +6,6 @@ from typing import List
|
|||
from unittest import TestCase
|
||||
from unittest.mock import patch, MagicMock
|
||||
|
||||
from cura.CuraApplication import CuraApplication
|
||||
from cura.CuraConstants import CuraCloudAPIRoot
|
||||
from src.Cloud.CloudApiClient import CloudApiClient
|
||||
from src.Cloud.Models.CloudClusterResponse import CloudClusterResponse
|
||||
|
@ -29,7 +28,6 @@ class TestCloudApiClient(TestCase):
|
|||
self.account = MagicMock()
|
||||
self.account.isLoggedIn.return_value = True
|
||||
|
||||
self.app = CuraApplication.getInstance()
|
||||
self.network = NetworkManagerMock()
|
||||
with patch("src.Cloud.CloudApiClient.QNetworkAccessManager", return_value = self.network):
|
||||
self.api = CloudApiClient(self.account, self._errorHandler)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue