Skip to content
Snippets Groups Projects

Remove test specific method from PlotterEditor

Merged Samuel GAIST requested to merge plottereditor_remove_test_specific_method into v2
2 files
+ 14
19
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -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])
Loading