Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.editor
Commits
12a3ff65
Commit
12a3ff65
authored
Aug 06, 2020
by
Amir MOHAMMADI
Browse files
Merge branch '275_fix_algorithm_migration' into 'master'
Fix algorithm migration handling Closes
#275
See merge request
!143
parents
78c47654
c5f2970b
Pipeline
#41806
passed with stages
in 13 minutes and 3 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
beat/editor/test/test_algorithmeditor.py
View file @
12a3ff65
...
...
@@ -105,7 +105,7 @@ class TestHelperMethods:
assert
v1_declaration
!=
v2_declaration
assert
v2_declaration
[
"schema_version"
]
==
2
assert
v2_declaration
[
"api_version"
]
==
2
assert
v2_declaration
[
"type"
]
==
"
legacy
"
assert
v2_declaration
[
"type"
]
==
"
sequential
"
@
pytest
.
mark
.
parametrize
(
[
"algorithm_name"
,
"new_type"
,
"field_to_add"
],
...
...
beat/editor/test/test_assetwidget.py
View file @
12a3ff65
...
...
@@ -23,6 +23,7 @@
# #
###############################################################################
import
json
import
os
import
random
...
...
@@ -591,6 +592,10 @@ class TestAssetWidget:
asset_widget
.
loadAsset
(
asset
)
assert
asset_widget
.
current_asset
.
name
==
"v1/sum/2"
assert
(
json
.
loads
(
asset_widget
.
json_widget
.
toPlainText
())
==
asset_widget
.
current_asset
.
declaration
)
def
test_experiment_error_hinting
(
self
,
qtbot
,
test_prefix
,
beat_context
):
asset_widget
=
AssetWidget
()
...
...
beat/editor/widgets/algorithmeditor.py
View file @
12a3ff65
...
...
@@ -96,7 +96,7 @@ def migrate_to_api_v2(asset):
declaration
=
new_asset
.
declaration
declaration
[
"api_version"
]
=
2
declaration
[
"schema_version"
]
=
2
declaration
[
"type"
]
=
"
legacy
"
declaration
[
"type"
]
=
"
sequential
"
new_asset
.
declaration
=
declaration
return
status
,
new_asset
...
...
beat/editor/widgets/assetwidget.py
View file @
12a3ff65
...
...
@@ -492,6 +492,7 @@ class AssetWidget(QWidget):
status
,
asset
=
migrate_to_api_v2
(
asset
)
if
status
:
update_code
(
asset
)
declaration
=
asset
.
declaration
else
:
QMessageBox
.
information
(
self
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment