From b8b529ad169fa46aedbf8386e5877115d3dc5c90 Mon Sep 17 00:00:00 2001 From: Flavio Tarsetti <Flavio.Tarsetti@idiap.ch> Date: Tue, 26 Feb 2019 15:55:28 +0100 Subject: [PATCH] [test] updated/refactored test for description widget --- beat/editor/test/test_editors.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/beat/editor/test/test_editors.py b/beat/editor/test/test_editors.py index bf2e9f90..058b1379 100644 --- a/beat/editor/test/test_editors.py +++ b/beat/editor/test/test_editors.py @@ -45,7 +45,9 @@ class MockAssetEditor(AbstractAssetEditor): super(MockAssetEditor, self).__init__(parent) self.dataformat_model = None self.add_field_button = QPushButton(self.tr("Add")) + self.description = DescriptionWidget() layout = QVBoxLayout(self) + layout.addWidget(self.description) layout.addWidget(self.add_field_button) self.add_field_button.clicked.connect(self.__add_field) @@ -80,19 +82,12 @@ class MockAssetEditor(AbstractAssetEditor): def set_description(self, desc): """Sets the text description of the asset""" - description = DescriptionWidget() - description.short_description = desc - self.layout().addWidget(description) + self.description.short_description = desc def get_description(self): """Returns the text description of the asset""" - description_list = self.findChildren(DescriptionWidget) - - text_data = None - - description = description_list[0] - text_data = description.short_description + text_data = self.description.short_description return text_data -- GitLab