-
Notifications
You must be signed in to change notification settings - Fork 37
1163 support signal[t] | none syntax in devicefiller #1165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
a2768f1
ed488ed
82d3d0e
2e61c75
83d79e2
c4751f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -114,6 +114,7 @@ def _fill_child(self, name: str, entry: Entry, vector_index: int | None = None): | |
| async def connect_mock(self, device: Device, mock: LazyMock): | ||
| self.filler.create_device_vector_entries_to_mock(self.mock_device_vector_len) | ||
| # Set the name of the device to name all children | ||
| self.filler.check_filled("") | ||
|
||
| device.set_name(device.name) | ||
| return await super().connect_mock(device, mock) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,6 +52,10 @@ class Block4(StandardReadable): | |
| signal_rw: SignalRW[int] | ||
|
|
||
|
|
||
| class Block5(Device): | ||
| signal_rw: SignalRW[int] | None | ||
|
|
||
|
|
||
| DeviceT = TypeVar("DeviceT", bound=Device) | ||
|
|
||
|
|
||
|
|
@@ -133,6 +137,19 @@ async def test_device_create_children_from_annotations(): | |
| assert device.signal_device is top_block_1_device | ||
|
|
||
|
|
||
| async def test_device_create_children_from_annotations_filler(): | ||
| device = with_pvi_connector(Block5, "PREFIX:") | ||
|
|
||
| # Makes sure before connecting we create a signal and it exists in the device | ||
| assert hasattr(device, "signal_rw") | ||
| assert isinstance(device.signal_rw, SignalRW) | ||
|
|
||
| await device.connect(mock=True) | ||
|
|
||
| # After connecting if the signal is not present it's set to None | ||
| assert device.signal_rw is None | ||
|
||
|
|
||
|
|
||
| async def test_device_create_children_from_annotations_with_device_vectors(): | ||
| device = with_pvi_connector(Block4, "PREFIX:", name="test_device") | ||
| await device.connect(mock=True) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.