Commit 8846a2dd authored by Flavio TARSETTI's avatar Flavio TARSETTI

[test][toolchaineditor] load/dump toolchain

parent 40679532
...@@ -29,7 +29,7 @@ from ..backend.asset import Asset ...@@ -29,7 +29,7 @@ from ..backend.asset import Asset
from ..backend.asset import AssetType from ..backend.asset import AssetType
from ..backend.assetmodel import AssetModel from ..backend.assetmodel import AssetModel
# from ..widgets.toolchaineditor import ToolchainEditor from ..widgets.toolchaineditor import ToolchainEditor
from .conftest import sync_prefix from .conftest import sync_prefix
from .conftest import prefix from .conftest import prefix
...@@ -58,14 +58,10 @@ class TestToolchainEditor: ...@@ -58,14 +58,10 @@ class TestToolchainEditor:
@pytest.mark.parametrize("toolchain", get_valid_toolchains(prefix)) @pytest.mark.parametrize("toolchain", get_valid_toolchains(prefix))
def test_load_and_dump(self, qtbot, test_prefix, toolchain): def test_load_and_dump(self, qtbot, test_prefix, toolchain):
pass
reference_json = get_toolchain_declaration(test_prefix, toolchain)
editor = ToolchainEditor()
# reference_json = get_toolchain_declaration(test_prefix, toolchain) editor.load_json(reference_json)
# editor = ToolchainEditor()
assert editor.dump_json() == reference_json
#
# editor.load_json(reference_json)
#
# assert editor.dump_json() == reference_json
...@@ -1793,7 +1793,12 @@ class Toolchain(QWidget): ...@@ -1793,7 +1793,12 @@ class Toolchain(QWidget):
"width": int(block.custom_width), "width": int(block.custom_width),
"height": int(block.custom_height), "height": int(block.custom_height),
} }
data[block_type.value] = block_type_list
if block_type == BlockType.LOOPS:
if has_loops:
data[block_type.value] = block_type_list
else:
data[block_type.value] = block_type_list
connection_list = [] connection_list = []
for connection in self.connections: for connection in self.connections:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment