mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-13 19:21:50 +02:00
test: add tests for config dialog
This commit is contained in:
@ -430,7 +430,7 @@ class ListMetadataField(DynamicFormItem):
|
||||
return self._data
|
||||
|
||||
def setValue(self, value: list):
|
||||
if set(map(type, value)) != {self._types.item}:
|
||||
if set(map(type, value)) | {self._types.item} != {self._types.item}:
|
||||
raise ValueError(f"This widget only accepts items of type {self._types.item}")
|
||||
self._repop(value)
|
||||
|
||||
|
@ -193,8 +193,8 @@ class DictBackedTable(QWidget):
|
||||
def clear(self):
|
||||
self._table_model.replaceData({})
|
||||
|
||||
def replace_data(self, data: dict):
|
||||
self._table_model.replaceData(data)
|
||||
def replace_data(self, data: dict | None):
|
||||
self._table_model.replaceData(data or {})
|
||||
|
||||
def delete_selected_rows(self):
|
||||
"""Delete rows which are part of the selection model"""
|
||||
|
@ -28,9 +28,13 @@ class DeviceConfigDialog(BECWidget, QDialog):
|
||||
RPC = False
|
||||
|
||||
def __init__(
|
||||
self, parent=None, device: str | None = None, config_helper: ConfigHelper | None = None
|
||||
self,
|
||||
parent=None,
|
||||
device: str | None = None,
|
||||
config_helper: ConfigHelper | None = None,
|
||||
**kwargs,
|
||||
):
|
||||
super().__init__(parent=parent)
|
||||
super().__init__(parent=parent, **kwargs)
|
||||
self._config_helper = config_helper or ConfigHelper(
|
||||
self.client.connector, self.client._service_name
|
||||
)
|
||||
|
Reference in New Issue
Block a user