From 76542a82d5a19b3dd9ea2a3f2c785d8fd956fc57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marijn=20De=C3=A9?= Date: Fri, 23 Nov 2018 10:33:57 +0100 Subject: [PATCH] Removed the asserts on internals --- .../tests/TestSendMaterialJob.py | 22 ++----------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/plugins/UM3NetworkPrinting/tests/TestSendMaterialJob.py b/plugins/UM3NetworkPrinting/tests/TestSendMaterialJob.py index f5a475b3ab..b669eb192a 100644 --- a/plugins/UM3NetworkPrinting/tests/TestSendMaterialJob.py +++ b/plugins/UM3NetworkPrinting/tests/TestSendMaterialJob.py @@ -1,4 +1,5 @@ # Copyright (c) 2018 Ultimaker B.V. +# Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import io import json @@ -66,8 +67,7 @@ class TestSendMaterialJob(TestCase): job = SendMaterialJob(device_mock) job._onGetRemoteMaterials(reply_mock) - # We expect the error string to be retrieved and the device not to be called for any follow up. - self.assertEqual([call.attribute(0), call.errorString()], reply_mock.method_calls) + # We expect the device not to be called for any follow up. self.assertEqual(0, device_mock.createFormPart.call_count) def test__onGetRemoteMaterials_withWrongEncoding(self, reply_mock, device_mock): @@ -76,9 +76,7 @@ class TestSendMaterialJob(TestCase): job = SendMaterialJob(device_mock) job._onGetRemoteMaterials(reply_mock) - # We expect the reply to be called once to try to get the printers from the list (readAll()). # Given that the parsing fails we do no expect the device to be called for any follow up. - self.assertEqual([call.attribute(0), call.readAll()], reply_mock.method_calls) self.assertEqual(0, device_mock.createFormPart.call_count) def test__onGetRemoteMaterials_withBadJsonAnswer(self, reply_mock, device_mock): @@ -87,9 +85,7 @@ class TestSendMaterialJob(TestCase): job = SendMaterialJob(device_mock) job._onGetRemoteMaterials(reply_mock) - # We expect the reply to be called once to try to get the printers from the list (readAll()). # Given that the parsing fails we do no expect the device to be called for any follow up. - self.assertEqual([call.attribute(0), call.readAll()], reply_mock.method_calls) self.assertEqual(0, device_mock.createFormPart.call_count) def test__onGetRemoteMaterials_withMissingGuidInRemoteMaterial(self, reply_mock, device_mock): @@ -100,9 +96,7 @@ class TestSendMaterialJob(TestCase): job = SendMaterialJob(device_mock) job._onGetRemoteMaterials(reply_mock) - # We expect the reply to be called once to try to get the printers from the list (readAll()). # Given that parsing fails we do not expect the device to be called for any follow up. - self.assertEqual([call.attribute(0), call.readAll()], reply_mock.method_calls) self.assertEqual(0, device_mock.createFormPart.call_count) @patch("cura.Settings.CuraContainerRegistry") @@ -122,9 +116,6 @@ class TestSendMaterialJob(TestCase): job = SendMaterialJob(device_mock) job._onGetRemoteMaterials(reply_mock) - self.assertEqual([call.attribute(0), call.readAll()], reply_mock.method_calls) - self.assertEqual([call.getContainerRegistry()], application_mock.method_calls) - self.assertEqual([call.findContainersMetadata(type = "material")], container_registry_mock.method_calls) self.assertEqual(0, device_mock.createFormPart.call_count) @patch("cura.Settings.CuraContainerRegistry") @@ -144,9 +135,6 @@ class TestSendMaterialJob(TestCase): job = SendMaterialJob(device_mock) job._onGetRemoteMaterials(reply_mock) - self.assertEqual([call.attribute(0), call.readAll()], reply_mock.method_calls) - self.assertEqual([call.getContainerRegistry()], application_mock.method_calls) - self.assertEqual([call.findContainersMetadata(type = "material")], container_registry_mock.method_calls) self.assertEqual(0, device_mock.createFormPart.call_count) self.assertEqual(0, device_mock.postFormWithParts.call_count) @@ -169,9 +157,6 @@ class TestSendMaterialJob(TestCase): job = SendMaterialJob(device_mock) job._onGetRemoteMaterials(reply_mock) - self.assertEqual([call.attribute(0), call.readAll()], reply_mock.method_calls) - self.assertEqual([call.getContainerRegistry()], application_mock.method_calls) - self.assertEqual([call.findContainersMetadata(type = "material")], container_registry_mock.method_calls) self.assertEqual(1, device_mock.createFormPart.call_count) self.assertEqual(1, device_mock.postFormWithParts.call_count) self.assertEquals( @@ -197,9 +182,6 @@ class TestSendMaterialJob(TestCase): job = SendMaterialJob(device_mock) job._onGetRemoteMaterials(reply_mock) - self.assertEqual([call.attribute(0), call.readAll()], reply_mock.method_calls) - self.assertEqual([call.getContainerRegistry()], application_mock.method_calls) - self.assertEqual([call.findContainersMetadata(type = "material")], container_registry_mock.method_calls) self.assertEqual(1, device_mock.createFormPart.call_count) self.assertEqual(1, device_mock.postFormWithParts.call_count) self.assertEquals(