Commit 71baf4b3 authored by Flavio TARSETTI's avatar Flavio TARSETTI Committed by Flavio TARSETTI
Browse files

[test] adding tests for reusable component description

parent 722ea169
......@@ -33,6 +33,7 @@ from PyQt5.QtWidgets import QVBoxLayout
from ..widgets.editor import AbstractAssetEditor
from ..widgets.field import FieldWidget
from ..widgets.description import DescriptionWidget
class MockAssetEditor(AbstractAssetEditor):
......@@ -76,6 +77,25 @@ class MockAssetEditor(AbstractAssetEditor):
return json_data
def set_description(self, desc):
"""Sets the text description of the asset"""
description = DescriptionWidget()
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
return text_data
def dataformat_model():
......@@ -121,3 +141,12 @@ class TestMockEditor:
field.format_type = "float64"
assert widget.dump_json() == {"value32": "float32", "value64": "float64"}
def test_description_set_and_get(self, qtbot, dataformat_model):
text_reference = "short descr1iption of a beat object"
widget = MockAssetEditor()
assert widget.get_description() == text_reference
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment