mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-12 17:27:51 -06:00
STAR-322: Using a test setup to run tests with Cura app
This commit is contained in:
parent
134f97d5f1
commit
f432d7c858
5 changed files with 58 additions and 17 deletions
|
@ -66,7 +66,8 @@ class NetworkManagerMock:
|
|||
# \return The data in the response.
|
||||
def prepareGetClusters(self, data: Optional[dict] = None) -> dict:
|
||||
data, response = self._getResponseData("clusters", data)
|
||||
self.prepareReply("GET", "https://api-staging.ultimaker.com/connect/v1/clusters", 200, response)
|
||||
status_code = 200 if "data" in data else int(data["errors"][0]["http_status"])
|
||||
self.prepareReply("GET", "https://api-staging.ultimaker.com/connect/v1/clusters", status_code, response)
|
||||
return data
|
||||
|
||||
## Gets the data that should be in the server's response in both dictionary and JSON-encoded bytes format.
|
||||
|
@ -87,6 +88,7 @@ class NetworkManagerMock:
|
|||
def flushReplies(self):
|
||||
for reply in self.replies.values():
|
||||
self.finished.emit(reply)
|
||||
self.reset()
|
||||
|
||||
## Deletes all prepared replies
|
||||
def reset(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue