mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Test fixes, not working yet
This commit is contained in:
parent
73b423138a
commit
882352c99d
2 changed files with 10 additions and 3 deletions
|
@ -25,7 +25,7 @@ class ExtruderConfigurationModel(QObject):
|
||||||
return self._position
|
return self._position
|
||||||
|
|
||||||
def setMaterial(self, material: Optional[MaterialOutputModel]) -> None:
|
def setMaterial(self, material: Optional[MaterialOutputModel]) -> None:
|
||||||
if self._hotend_id != material:
|
if self._material != material:
|
||||||
self._material = material
|
self._material = material
|
||||||
self.extruderConfigurationChanged.emit()
|
self.extruderConfigurationChanged.emit()
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ class ExtruderConfigurationModel(QObject):
|
||||||
def activeMaterial(self) -> Optional[MaterialOutputModel]:
|
def activeMaterial(self) -> Optional[MaterialOutputModel]:
|
||||||
return self._material
|
return self._material
|
||||||
|
|
||||||
@pyqtProperty(QObject, fset=setMaterial, notify=extruderConfigurationChanged)
|
@pyqtProperty(QObject, fset = setMaterial, notify = extruderConfigurationChanged)
|
||||||
def material(self) -> Optional[MaterialOutputModel]:
|
def material(self) -> Optional[MaterialOutputModel]:
|
||||||
return self._material
|
return self._material
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,12 @@ def test_uniqueConfigurations(printer_output_device):
|
||||||
# Once the type of printer is set, it's active configuration counts as being set.
|
# Once the type of printer is set, it's active configuration counts as being set.
|
||||||
# In that case, that should also be added to the list of available configurations
|
# In that case, that should also be added to the list of available configurations
|
||||||
printer.updateType("blarg!")
|
printer.updateType("blarg!")
|
||||||
|
loaded_material = MaterialOutputModel(guid = "", type = "PLA", color = "Blue", brand = "Generic", name = "Blue PLA")
|
||||||
|
loaded_left_extruder = ExtruderConfigurationModel(0)
|
||||||
|
loaded_left_extruder.setMaterial(loaded_material)
|
||||||
|
loaded_right_extruder = ExtruderConfigurationModel(1)
|
||||||
|
loaded_right_extruder.setMaterial(loaded_material)
|
||||||
|
printer.printerConfiguration.setExtruderConfigurations([loaded_left_extruder, loaded_right_extruder])
|
||||||
assert printer_output_device.uniqueConfigurations == [configuration, printer.printerConfiguration]
|
assert printer_output_device.uniqueConfigurations == [configuration, printer.printerConfiguration]
|
||||||
|
|
||||||
|
|
||||||
|
@ -72,10 +78,11 @@ def test_uniqueConfigurations_empty_is_filtered_out(printer_output_device):
|
||||||
printer_output_device._printers = [printer]
|
printer_output_device._printers = [printer]
|
||||||
printer_output_device._onPrintersChanged()
|
printer_output_device._onPrintersChanged()
|
||||||
|
|
||||||
|
printer.updateType("blarg!")
|
||||||
empty_material = MaterialOutputModel(guid = "", type = "empty", color = "empty", brand = "Generic", name = "Empty")
|
empty_material = MaterialOutputModel(guid = "", type = "empty", color = "empty", brand = "Generic", name = "Empty")
|
||||||
empty_left_extruder = ExtruderConfigurationModel(0)
|
empty_left_extruder = ExtruderConfigurationModel(0)
|
||||||
empty_left_extruder.setMaterial(empty_material)
|
empty_left_extruder.setMaterial(empty_material)
|
||||||
empty_right_extruder = ExtruderConfigurationModel(1)
|
empty_right_extruder = ExtruderConfigurationModel(1)
|
||||||
empty_right_extruder.setMaterial(empty_material)
|
empty_right_extruder.setMaterial(empty_material)
|
||||||
printer.printerConfiguration.setExtruderConfigurations([empty_left_extruder, empty_right_extruder])
|
printer.printerConfiguration.setExtruderConfigurations([empty_left_extruder, empty_right_extruder])
|
||||||
assert printer_output_device.uniqueConfiguration == []
|
assert printer_output_device.uniqueConfigurations == []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue