Commit 7b324b1d authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[widgets][assetwidget] Update new experiment editing setup since the asset is now created

parent 05bdefcb
Pipeline #34028 failed with stage
in 2 minutes and 59 seconds
...@@ -226,10 +226,7 @@ class TestAssetWidget: ...@@ -226,10 +226,7 @@ class TestAssetWidget:
asset_model.prefix_path = test_prefix asset_model.prefix_path = test_prefix
target_name = f"{user}/{toolchain_name}/{asset_name}" target_name = f"{user}/{toolchain_name}/{asset_name}"
assert target_name not in asset_model.stringList() assert target_name in asset_model.stringList()
with pytest.raises(ValueError):
assert not os.path.exists(asset_model.json_path(target_name))
assert asset_widget.save_button.isEnabled() assert asset_widget.save_button.isEnabled()
qtbot.mouseClick(asset_widget.save_button, QtCore.Qt.LeftButton) qtbot.mouseClick(asset_widget.save_button, QtCore.Qt.LeftButton)
......
...@@ -282,12 +282,14 @@ class AssetWidget(QWidget): ...@@ -282,12 +282,14 @@ class AssetWidget(QWidget):
asset, json_data = editor.createNewAsset() asset, json_data = editor.createNewAsset()
if asset and json_data: if asset and json_data:
self.current_asset = asset
# There's no file created yet
self.__clear_watcher() self.__clear_watcher()
self.current_asset = asset
self.__update_content(json_data) self.__update_content(json_data)
self.current_editor.setDirty() self.current_editor.setDirty()
self.save_button.setEnabled(True) self.save_button.setEnabled(True)
self.__update_editors_icon(False)
self.watcher.addPath(asset.declaration_path)
self.currentAssetChanged.emit(asset)
elif asset: elif asset:
self.loadAsset(asset) self.loadAsset(asset)
......
Supports Markdown
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