From 501e227e1ef279c5c6c855b417e148eae030bcb0 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Thu, 18 Jul 2019 14:47:28 +0200 Subject: [PATCH] [widgets][plottereditor] Remove test specific method It was not needed at all. --- beat/editor/test/test_plottereditor.py | 30 ++++++++++++-------------- beat/editor/widgets/plottereditor.py | 3 --- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/beat/editor/test/test_plottereditor.py b/beat/editor/test/test_plottereditor.py index 329a66c..9241ab2 100644 --- a/beat/editor/test/test_plottereditor.py +++ b/beat/editor/test/test_plottereditor.py @@ -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]) diff --git a/beat/editor/widgets/plottereditor.py b/beat/editor/widgets/plottereditor.py index a95d605..93e769b 100644 --- a/beat/editor/widgets/plottereditor.py +++ b/beat/editor/widgets/plottereditor.py @@ -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 -- GitLab