diff options
author | Lipu Fei <lipu.fei815@gmail.com> | 2019-11-12 16:33:54 +0300 |
---|---|---|
committer | Lipu Fei <lipu.fei815@gmail.com> | 2019-11-12 16:33:54 +0300 |
commit | 77c194464e5edd70aedd255163513970dfcf8032 (patch) | |
tree | 6b31f7b80b4ae64f8171fe6cd786e433622d530f | |
parent | 8228c6a7433ce7c3302fb89b637efcfd2b5e7614 (diff) |
Fix tests
-rw-r--r-- | tests/Machines/TestVariantNode.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/Machines/TestVariantNode.py b/tests/Machines/TestVariantNode.py index bc860058a1..6e3a469877 100644 --- a/tests/Machines/TestVariantNode.py +++ b/tests/Machines/TestVariantNode.py @@ -139,6 +139,7 @@ def test_preferredMaterialExactMatch(empty_variant_node): "some_different_material": MagicMock(getMetaDataEntry = lambda x: 3), "preferred_material_base_file": MagicMock(getMetaDataEntry = lambda x: 3) # Exact match. } + empty_variant_node.machine.preferred_material = "preferred_material_base_file" assert empty_variant_node.preferredMaterial(approximate_diameter = 3) == empty_variant_node.materials["preferred_material_base_file"], "It should match exactly on this one since it's the preferred material." @@ -149,6 +150,7 @@ def test_preferredMaterialSubmaterial(empty_variant_node): "some_different_material": MagicMock(getMetaDataEntry = lambda x: 3), "preferred_material_base_file_aa04": MagicMock(getMetaDataEntry = lambda x: 3) # This is a submaterial of the preferred material. } + empty_variant_node.machine.preferred_material = "preferred_material_base_file_aa04" assert empty_variant_node.preferredMaterial(approximate_diameter = 3) == empty_variant_node.materials["preferred_material_base_file_aa04"], "It should match on the submaterial just as well." @@ -160,6 +162,7 @@ def test_preferredMaterialDiameter(empty_variant_node): "preferred_material_wrong_diameter": MagicMock(getMetaDataEntry = lambda x: 2), # Approximate diameter is 2 instead of 3. "preferred_material_correct_diameter": MagicMock(getMetaDataEntry = lambda x: 3) # Correct approximate diameter. } + empty_variant_node.machine.preferred_material = "preferred_material_correct_diameter" assert empty_variant_node.preferredMaterial(approximate_diameter = 3) == empty_variant_node.materials["preferred_material_correct_diameter"], "It should match only on the material with correct diameter." |