mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 03:31:50 +02:00
test: test_widget_io.py fixed
This commit is contained in:
@ -191,7 +191,8 @@ class WidgetHierarchy:
|
||||
config = {}
|
||||
widget_info = f"{widget.__class__.__name__} ({widget.objectName()})"
|
||||
|
||||
if grab_values and type(widget) in WidgetIO._handlers:
|
||||
# if grab_values and type(widget) in WidgetIO._handlers:
|
||||
if grab_values:
|
||||
value = WidgetIO.get_value(widget, ignore_errors=True)
|
||||
if value is not None or save_all:
|
||||
if widget_info not in config:
|
||||
|
@ -8,10 +8,7 @@ from PyQt5.QtWidgets import (
|
||||
QSpinBox,
|
||||
)
|
||||
|
||||
from bec_widgets.qt_utils.widget_hierarchy import (
|
||||
export_config_to_dict,
|
||||
import_config_from_dict,
|
||||
)
|
||||
from bec_widgets.qt_utils.widget_IO import WidgetHierarchy
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
@ -45,10 +42,10 @@ def test_export_import_config(example_widget):
|
||||
"QSpinBox ()": {"value": 10},
|
||||
}
|
||||
}
|
||||
import_config_from_dict(example_widget, initial_config, set_values=True)
|
||||
WidgetHierarchy.import_config_from_dict(example_widget, initial_config, set_values=True)
|
||||
|
||||
exported_config_full = export_config_to_dict(example_widget, grab_values=True)
|
||||
exported_config_reduced = export_config_to_dict(
|
||||
exported_config_full = WidgetHierarchy.export_config_to_dict(example_widget, grab_values=True)
|
||||
exported_config_reduced = WidgetHierarchy.export_config_to_dict(
|
||||
example_widget, grab_values=True, save_all=False
|
||||
)
|
||||
|
Reference in New Issue
Block a user