mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 16:09:01 +08:00
Fix TestLegacyProfileReader
This commit is contained in:
parent
c8486b8f01
commit
5e255b548e
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user