Fix materials API call

This commit is contained in:
Lipu Fei 2019-08-28 15:31:52 +02:00
parent bc4809d8f8
commit 6591593f59
2 changed files with 3 additions and 3 deletions

View File

@ -126,7 +126,7 @@ class SendMaterialJob(Job):
.format(file_name = signature_file_name), f.read()))
Logger.log("d", "Syncing material {material_id} with cluster.".format(material_id = material_id))
self.device.postFormWithParts(target = "materials/", parts = parts, on_finished = self.sendingFinished)
self.device.postFormWithParts(target = "/materials/", parts = parts, on_finished = self.sendingFinished)
## Check a reply from an upload to the printer and log an error when the call failed
@staticmethod

View File

@ -210,7 +210,7 @@ class TestSendMaterialJob(TestCase):
self.assertEqual(1, device_mock.postFormWithParts.call_count)
self.assertEqual(
[call.createFormPart("name=\"file\"; filename=\"generic_pla_white.xml.fdm_material\"", "<xml></xml>"),
call.postFormWithParts(target = "materials/", parts = ["_xXx_"], on_finished = job.sendingFinished)],
call.postFormWithParts(target = "/materials/", parts = ["_xXx_"], on_finished = job.sendingFinished)],
device_mock.method_calls)
@patch("UM.Application.Application.getInstance")
@ -240,5 +240,5 @@ class TestSendMaterialJob(TestCase):
self.assertEqual(1, device_mock.postFormWithParts.call_count)
self.assertEqual(
[call.createFormPart("name=\"file\"; filename=\"generic_pla_white.xml.fdm_material\"", "<xml></xml>"),
call.postFormWithParts(target = "materials/", parts = ["_xXx_"], on_finished = job.sendingFinished)],
call.postFormWithParts(target = "/materials/", parts = ["_xXx_"], on_finished = job.sendingFinished)],
device_mock.method_calls)