Merge WIP_onboarding

This commit is contained in:
Lipu Fei 2019-03-20 11:28:30 +01:00
commit c3c9c53f13
77 changed files with 265 additions and 308 deletions

View file

@ -4,7 +4,7 @@ from unittest.mock import MagicMock
from PyQt5.QtNetwork import QNetworkAccessManager
from PyQt5.QtCore import QUrl
from cura.PrinterOutput.NetworkedPrinterOutputDevice import NetworkedPrinterOutputDevice, AuthState
from cura.PrinterOutputDevice import ConnectionState
from cura.PrinterOutput.PrinterOutputDevice import ConnectionState
def test_properties():

View file

@ -1,7 +1,7 @@
from unittest.mock import MagicMock
import pytest
from cura.PrinterOutputDevice import PrinterOutputDevice
from cura.PrinterOutput.PrinterOutputDevice import PrinterOutputDevice
test_validate_data_get_set = [
{"attribute": "connectionText", "value": "yay"},
@ -34,4 +34,4 @@ def test_getAndSet(data):
# Attempt to set the value again
getattr(model, "set" + attribute)(data["value"])
# The signal should not fire again
assert signal.emit.call_count == 1
assert signal.emit.call_count == 1

View file

@ -5,7 +5,7 @@ import os.path
from UM.Preferences import Preferences
from UM.Resources import Resources
from cura.CuraApplication import CuraApplication
from cura.Machines.Models.SettingVisibilityPresetsModel import SettingVisibilityPresetsModel
from cura.UI.MachineModels.SettingVisibilityPresetsModel import SettingVisibilityPresetsModel
from cura.Settings.SettingVisibilityPreset import SettingVisibilityPreset
setting_visibility_preset_test_settings = {"test", "zomg", "derp", "yay", "whoo"}

View file

@ -4,7 +4,7 @@
import pytest
from cura.MachineAction import MachineAction
from cura.MachineActionManager import NotUniqueMachineActionError, UnknownMachineActionError
from cura.UI.MachineActionManager import NotUniqueMachineActionError, UnknownMachineActionError
from cura.Settings.GlobalStack import GlobalStack

View file

@ -1,7 +1,7 @@
import functools
from UM.Qt.Duration import Duration
from cura import PrintInformation
from cura.UI import PrintInformation
from cura.Settings.MachineManager import MachineManager
from unittest.mock import MagicMock, patch

View file

@ -2,16 +2,16 @@ from unittest.mock import MagicMock
import pytest
from cura.PrinterOutput.ConfigurationModel import ConfigurationModel
from cura.PrinterOutput.PrintJobOutputModel import PrintJobOutputModel
from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel
from cura.UI.PrinterConfigurationModel import PrinterConfigurationModel
from cura.UI.PrintJobOutputModel import PrintJobOutputModel
from cura.UI.PrinterOutputModel import PrinterOutputModel
test_validate_data_get_set = [
{"attribute": "compatibleMachineFamilies", "value": ["yay"]},
]
test_validate_data_get_update = [
{"attribute": "configuration", "value": ConfigurationModel()},
{"attribute": "configuration", "value": PrinterConfigurationModel()},
{"attribute": "owner", "value": "WHOO"},
{"attribute": "assignedPrinter", "value": PrinterOutputModel(MagicMock())},
{"attribute": "key", "value": "YAY"},

View file

@ -4,8 +4,8 @@ from unittest.mock import MagicMock
import pytest
from cura.PrinterOutput.ConfigurationModel import ConfigurationModel
from cura.PrinterOutput.ExtruderConfigurationModel import ExtruderConfigurationModel
from cura.UI.PrinterConfigurationModel import PrinterConfigurationModel
from cura.UI.ExtruderConfigurationModel import ExtruderConfigurationModel
test_validate_data_get_set = [
{"attribute": "extruderConfigurations", "value": [ExtruderConfigurationModel()]},
@ -16,7 +16,7 @@ test_validate_data_get_set = [
@pytest.mark.parametrize("data", test_validate_data_get_set)
def test_getAndSet(data):
model = ConfigurationModel()
model = PrinterConfigurationModel()
# Convert the first letter into a capital
attribute = list(data["attribute"])

View file

@ -4,8 +4,8 @@ from unittest.mock import MagicMock
import pytest
from cura.PrinterOutput.PrintJobOutputModel import PrintJobOutputModel
from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel
from cura.UI.PrintJobOutputModel import PrintJobOutputModel
from cura.UI.PrinterOutputModel import PrinterOutputModel
test_validate_data_get_set = [
{"attribute": "name", "value": "YAY"},

View file

@ -6,11 +6,8 @@
import unittest.mock
import pytest
import Arcus #Prevents error: "PyCapsule_GetPointer called with incorrect name" with conflicting SIP configurations between Arcus and PyQt: Import Arcus and Savitar first!
import Savitar
from UM.Qt.QtApplication import QtApplication #QtApplication import is required, even though it isn't used.
from cura.CuraApplication import CuraApplication
from cura.MachineActionManager import MachineActionManager
from cura.UI.MachineActionManager import MachineActionManager
# Create a CuraApplication object that will be shared among all tests. It needs to be initialized.