Remove trailing whitespace from Python files

This commit is contained in:
Nino van Hooff 2020-05-29 14:30:33 +02:00
parent 1e33360c35
commit 89f0970a88
157 changed files with 562 additions and 562 deletions

View file

@ -29,7 +29,7 @@ def container_registry():
@pytest.fixture
def empty_machine_node():
"""Creates a machine node without anything underneath it. No sub-nodes.
For testing stuff with machine nodes without testing _loadAll(). You'll need
to add subnodes manually in your test.
"""
@ -82,7 +82,7 @@ def test_metadataProperties(container_registry):
def test_getQualityGroupsBothExtrudersAvailable(empty_machine_node):
"""Test getting quality groups when there are quality profiles available for
the requested configurations on two extruders.
"""
@ -130,7 +130,7 @@ def test_getQualityGroupsBothExtrudersAvailable(empty_machine_node):
def test_getQualityGroupsAvailability(empty_machine_node):
"""Test the "is_available" flag on quality groups.
If a profile is available for a quality type on an extruder but not on all
extruders, there should be a quality group for it but it should not be made
available.

View file

@ -52,7 +52,7 @@ def machine_node():
@pytest.fixture
def empty_variant_node(machine_node):
"""Constructs a variant node without any subnodes.
This is useful for performing tests on VariantNode without being dependent
on how _loadAll works.
"""
@ -137,7 +137,7 @@ def test_materialAdded_update(container_registry, machine_node, metadata, change
def test_preferredMaterialExactMatch(empty_variant_node):
"""Tests the preferred material when the exact base file is available in the
materials list for this node.
"""
empty_variant_node.materials = {
@ -151,7 +151,7 @@ def test_preferredMaterialExactMatch(empty_variant_node):
def test_preferredMaterialSubmaterial(empty_variant_node):
"""Tests the preferred material when a submaterial is available in the
materials list for this node.
"""
empty_variant_node.materials = {

View file

@ -7,7 +7,7 @@ from UM.Signal import Signal
class MockContainer(ContainerInterface, UM.PluginObject.PluginObject):
"""Fake container class to add to the container registry.
This allows us to test the container registry without testing the container
class. If something is wrong in the container class it won't influence this
test.
@ -15,7 +15,7 @@ class MockContainer(ContainerInterface, UM.PluginObject.PluginObject):
def __init__(self, metadata = None):
"""Initialise a new definition container.
The container will have the specified ID and all metadata in the
provided dictionary.
"""
@ -29,7 +29,7 @@ class MockContainer(ContainerInterface, UM.PluginObject.PluginObject):
def getId(self):
"""Gets the ID that was provided at initialisation.
:return: The ID of the container.
"""
@ -37,10 +37,10 @@ class MockContainer(ContainerInterface, UM.PluginObject.PluginObject):
def getMetaData(self):
"""Gets all metadata of this container.
This returns the metadata dictionary that was provided in the
constructor of this mock container.
:return: The metadata for this container.
"""
@ -48,7 +48,7 @@ class MockContainer(ContainerInterface, UM.PluginObject.PluginObject):
def getMetaDataEntry(self, entry, default = None):
"""Gets a metadata entry from the metadata dictionary.
:param key: The key of the metadata entry.
:return: The value of the metadata entry, or None if there is no such
entry.
@ -60,7 +60,7 @@ class MockContainer(ContainerInterface, UM.PluginObject.PluginObject):
def getName(self):
"""Gets a human-readable name for this container.
:return: The name from the metadata, or "MockContainer" if there was no
name provided.
"""
@ -69,14 +69,14 @@ class MockContainer(ContainerInterface, UM.PluginObject.PluginObject):
@property
def isEnabled(self):
"""Get whether a container stack is enabled or not.
:return: Always returns True.
"""
return True
def isReadOnly(self):
"""Get whether the container item is stored on a read only location in the filesystem.
:return: Always returns False
"""
@ -110,9 +110,9 @@ class MockContainer(ContainerInterface, UM.PluginObject.PluginObject):
def getValue(self, key):
"""Get the value of a container item.
Since this mock container cannot contain any items, it always returns None.
:return: Always returns None.
"""
@ -120,7 +120,7 @@ class MockContainer(ContainerInterface, UM.PluginObject.PluginObject):
def hasProperty(self, key, property_name):
"""Get whether the container item has a specific property.
This method is not implemented in the mock container.
"""
@ -128,7 +128,7 @@ class MockContainer(ContainerInterface, UM.PluginObject.PluginObject):
def serialize(self, ignored_metadata_keys = None):
"""Serializes the container to a string representation.
This method is not implemented in the mock container.
"""
@ -136,7 +136,7 @@ class MockContainer(ContainerInterface, UM.PluginObject.PluginObject):
def deserialize(self, serialized, file_name: Optional[str] = None):
"""Deserializes the container from a string representation.
This method is not implemented in the mock container.
"""

View file

@ -89,7 +89,7 @@ def assertIsDefinitionValid(definition_container, file_path):
@pytest.mark.parametrize("file_path", definition_filepaths)
def test_validateOverridingDefaultValue(file_path: str):
"""Tests whether setting values are not being hidden by parent containers.
When a definition container defines a "default_value" but inherits from a
definition that defines a "value", the "default_value" is ineffective. This
test fails on those things.
@ -135,7 +135,7 @@ def getInheritedSettings(definition_id: str) -> Dict[str, Any]:
def flattenSettings(settings: Dict[str, Any]) -> Dict[str, Any]:
"""Put all settings in the main dictionary rather than in children dicts.
:param settings: Nested settings. The keys are the setting IDs. The values
are dictionaries of properties per setting, including the "children" property.
:return: A dictionary of settings by key. Each setting is a dictionary of properties.
@ -152,7 +152,7 @@ def flattenSettings(settings: Dict[str, Any]) -> Dict[str, Any]:
def merge_dicts(base: Dict[str, Any], overrides: Dict[str, Any]) -> Dict[str, Any]:
"""Make one dictionary override the other. Nested dictionaries override each
other in the same way.
:param base: A dictionary of settings that will get overridden by the other.
:param overrides: A dictionary of settings that will override the other.
@ -176,7 +176,7 @@ def merge_dicts(base: Dict[str, Any], overrides: Dict[str, Any]) -> Dict[str, An
@pytest.mark.parametrize("file_path", definition_filepaths)
def test_noId(file_path: str):
"""Verifies that definition contains don't have an ID field.
ID fields are legacy. They should not be used any more. This is legacy that
people don't seem to be able to get used to.
"""

View file

@ -16,7 +16,7 @@ from cura.Settings.cura_empty_instance_containers import empty_container
def getInstanceContainer(container_type) -> InstanceContainer:
"""Gets an instance container with a specified container type.
:param container_type: The type metadata for the instance container.
:return: An instance container instance.
"""

View file

@ -18,7 +18,7 @@ from cura.Settings.cura_empty_instance_containers import empty_container
def getInstanceContainer(container_type) -> InstanceContainer:
"""Gets an instance container with a specified container type.
:param container_type: The type metadata for the instance container.
:return: An instance container instance.
"""
@ -219,7 +219,7 @@ def test_constrainDefinitionValid(container, global_stack):
def test_deserializeCompletesEmptyContainers(global_stack):
"""Tests whether deserialising completes the missing containers with empty ones. The initial containers are just the
definition and the definition_changes (that cannot be empty after CURA-5281)
"""