Skip to content
GitLab
Menu
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
501e227e
Commit
501e227e
authored
Jul 18, 2019
by
Samuel GAIST
Browse files
[widgets][plottereditor] Remove test specific method
It was not needed at all.
parent
459d8c32
Pipeline
#31926
passed with stage
in 11 minutes and 13 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
beat/editor/test/test_plottereditor.py
View file @
501e227e
...
...
@@ -79,31 +79,29 @@ class TestParameterViewer:
class
TestPlotterEditor
:
"""Test that the plotter editor works correctly"""
def
test_load_and_dump
(
self
,
qtbot
,
dataformat_model
,
test_prefix
):
def
test_load_and_dump
(
self
,
qtbot
,
dataformat_model
,
test_prefix
,
beat_context
):
asset_name
=
"user/scatter/1"
asset
=
Asset
(
test_prefix
,
AssetType
.
PLOTTER
,
asset_name
)
with
open
(
asset
.
declaration_path
,
"rt"
)
as
json_file
:
json_data
=
json
.
load
(
json_file
)
editor
=
PlotterEditor
()
editor
.
set_dataformat_model_to_combobox
(
dataformat_model
)
editor
.
load_json
(
json_data
)
json_data
=
asset
.
declaration
editor
=
PlotterEditor
()
editor
.
set_context
(
beat_context
)
editor
.
load_json
(
json_data
)
qtbot
.
addWidget
(
editor
)
qtbot
.
addWidget
(
editor
)
assert
editor
.
dump_json
()
==
json_data
assert
editor
.
dump_json
()
==
json_data
def
test_change_dataformat
(
self
,
qtbot
,
dataformat_model
,
test_prefix
):
def
test_change_dataformat
(
self
,
qtbot
,
dataformat_model
,
test_prefix
,
beat_context
):
asset_name
=
"user/scatter/1"
asset
=
Asset
(
test_prefix
,
AssetType
.
PLOTTER
,
asset_name
)
with
open
(
asset
.
declaration_path
,
"rt"
)
as
json_file
:
json_data
=
json
.
load
(
json_file
)
editor
=
PlotterEditor
()
editor
.
set_dataformat_model_to_combobox
(
dataformat_model
)
editor
.
load_json
(
json_data
)
json_data
=
asset
.
declaration
editor
=
PlotterEditor
()
editor
.
set_context
(
beat_context
)
editor
.
load_json
(
json_data
)
qtbot
.
addWidget
(
editor
)
qtbot
.
addWidget
(
editor
)
assert
editor
.
dump_json
()
==
json_data
assert
editor
.
dump_json
()
==
json_data
asset_list
=
dataformat_model
.
stringList
()
qtbot
.
keyClicks
(
editor
.
dataformat_combobox
,
asset_list
[
1
])
...
...
beat/editor/widgets/plottereditor.py
View file @
501e227e
...
...
@@ -151,9 +151,6 @@ class PlotterEditor(AbstractAssetEditor):
lambda
:
self
.
library_model
.
setPrefixPath
(
self
.
prefix_path
)
)
def
set_dataformat_model_to_combobox
(
self
,
dataformat_model
):
self
.
dataformat_combobox
.
setModel
(
dataformat_model
)
@
property
def
parameter_viewers
(
self
):
return
self
.
scroll_widget
.
widget_list
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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