mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-02 00:34:26 +08:00
STAR-322: Sorting clusters
This commit is contained in:
parent
34f56b046a
commit
a1cb09f73f
@ -18,6 +18,8 @@ from .NetworkManagerMock import NetworkManagerMock
|
||||
|
||||
|
||||
class TestCloudApiClient(TestCase):
|
||||
maxDiff = None
|
||||
|
||||
def _errorHandler(self, errors: List[CloudErrorObject]):
|
||||
raise Exception("Received unexpected error: {}".format(errors))
|
||||
|
||||
|
@ -16,6 +16,8 @@ from .NetworkManagerMock import NetworkManagerMock
|
||||
|
||||
|
||||
class TestCloudOutputDevice(TestCase):
|
||||
maxDiff = None
|
||||
|
||||
CLUSTER_ID = "RIZ6cZbWA_Ua7RZVJhrdVfVpf0z-MqaSHQE4v8aRTtYq"
|
||||
JOB_ID = "ABCDefGHIjKlMNOpQrSTUvYxWZ0-1234567890abcDE="
|
||||
HOST_NAME = "ultimakersystem-ccbdd30044ec"
|
||||
|
@ -11,6 +11,8 @@ from .NetworkManagerMock import NetworkManagerMock
|
||||
|
||||
|
||||
class TestCloudOutputDeviceManager(TestCase):
|
||||
maxDiff = None
|
||||
|
||||
URL = "https://api-staging.ultimaker.com/connect/v1/clusters"
|
||||
|
||||
def setUp(self):
|
||||
@ -41,7 +43,8 @@ class TestCloudOutputDeviceManager(TestCase):
|
||||
clusters = self.clusters_response.get("data", [])
|
||||
self.assertEqual([CloudOutputDevice] * len(clusters), [type(d) for d in devices])
|
||||
self.assertEqual({cluster["cluster_id"] for cluster in clusters}, {device.key for device in devices})
|
||||
self.assertEqual(clusters, [device.clusterData.toDict() for device in devices])
|
||||
self.assertEqual(clusters, sorted((device.clusterData.toDict() for device in devices),
|
||||
key=lambda device_dict: device_dict["host_version"]))
|
||||
|
||||
for device in clusters:
|
||||
device_manager.getOutputDevice(device["cluster_id"]).close()
|
||||
|
Loading…
x
Reference in New Issue
Block a user