Rewrite test_setPropertyUser

It now only checks if setProperty is being called on the user changes instance, not what the result of that should be.

Contributes to issue CURA-3497.
This commit is contained in:
Ghostkeeper 2017-04-12 09:15:42 +02:00
parent 52d6c074f5
commit 7f1930d452
No known key found for this signature in database
GPG Key ID: C5F96EE2BC0F7E75

View File

@ -543,9 +543,13 @@ def test_setNextStack(global_stack):
("layer_height", "default_value", 0.1337, 0.1337),
("layer_height", "is_bright_pink", "of course", "of course")
])
def test_setPropertyUser(key, property, value, output_value, writable_global_stack):
writable_global_stack.setProperty(key, property, value)
assert writable_global_stack.userChanges.getProperty(key, property) == output_value
def test_setPropertyUser(key, property, value, output_value, global_stack):
user_changes = unittest.mock.MagicMock()
user_changes.getMetaDataEntry = unittest.mock.MagicMock(return_value = "user")
global_stack.userChanges = user_changes
global_stack.setProperty(key, property, value)
global_stack.userChanges.setProperty.assert_called_once_with(key, property, value)
## Tests setting properties on specific containers on the global stack.
@pytest.mark.parametrize("target_container", [