mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Fix TestLegacyProfileReader
This commit is contained in:
parent
c8486b8f01
commit
5e255b548e
1 changed files with 3 additions and 3 deletions
|
@ -5,7 +5,6 @@ import configparser # An input for some functions we're testing.
|
|||
import os.path # To find the integration test .ini files.
|
||||
import pytest # To register tests with.
|
||||
import unittest.mock # To mock the application, plug-in and container registry out.
|
||||
import os.path
|
||||
import sys
|
||||
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))
|
||||
|
||||
|
@ -16,6 +15,7 @@ import UM.Settings.InstanceContainer # To intercept the serialised data from the
|
|||
|
||||
import LegacyProfileReader as LegacyProfileReaderModule # To get the directory of the module.
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def legacy_profile_reader():
|
||||
try:
|
||||
|
@ -162,7 +162,7 @@ def test_read(legacy_profile_reader, file_name):
|
|||
plugin_registry.getPluginPath = unittest.mock.MagicMock(return_value = os.path.dirname(LegacyProfileReaderModule.__file__))
|
||||
|
||||
# Mock out the resulting InstanceContainer so that we can intercept the data before it's passed through the version upgrader.
|
||||
def deserialize(self, data): # Intercepts the serialised data that we'd perform the version upgrade from when deserializing.
|
||||
def deserialize(self, data, filename): # Intercepts the serialised data that we'd perform the version upgrade from when deserializing.
|
||||
global intercepted_data
|
||||
intercepted_data = data
|
||||
|
||||
|
@ -192,4 +192,4 @@ def test_read(legacy_profile_reader, file_name):
|
|||
assert parser["metadata"]["type"] == "quality_changes"
|
||||
assert parser["metadata"]["quality_type"] == "normal"
|
||||
assert parser["metadata"]["position"] == "0"
|
||||
assert parser["metadata"]["setting_version"] == "5" # Yes, before we upgraded.
|
||||
assert parser["metadata"]["setting_version"] == "5" # Yes, before we upgraded.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue