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
b8b529ad
Commit
b8b529ad
authored
Feb 26, 2019
by
Flavio TARSETTI
Browse files
[test] updated/refactored test for description widget
parent
4d452a77
Changes
1
Hide whitespace changes
Inline
Side-by-side
beat/editor/test/test_editors.py
View file @
b8b529ad
...
...
@@ -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
...
...
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