-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from tangkong/enh_client_apply
ENH: add Client.apply method, adjust TaskStatus to properly capture exceptions
- Loading branch information
Showing
9 changed files
with
254 additions
and
18 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
docs/source/upcoming_release_notes/53-enh_client_apply.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
53 enh_client_apply | ||
################### | ||
|
||
API Breaks | ||
---------- | ||
- N/A | ||
|
||
Features | ||
-------- | ||
- Implements `Client.apply` method for writing values from `Entry` data to the control system. | ||
|
||
Bugfixes | ||
-------- | ||
- N/A | ||
|
||
Maintenance | ||
----------- | ||
- Adjusts `TaskStatus` use to properly capture exceptions. | ||
|
||
Contributors | ||
------------ | ||
- tangkong |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from .core import ControlLayer # noqa | ||
from .status import TaskStatus # noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from unittest.mock import patch | ||
|
||
from superscore.client import Client | ||
from superscore.model import Root | ||
|
||
from .conftest import MockTaskStatus | ||
|
||
|
||
@patch('superscore.control_layers.core.ControlLayer.put') | ||
def test_apply(put_mock, mock_client: Client, sample_database: Root): | ||
put_mock.return_value = MockTaskStatus() | ||
snap = sample_database.entries[3] | ||
mock_client.apply(snap) | ||
assert put_mock.call_count == 1 | ||
call_args = put_mock.call_args[0] | ||
assert len(call_args[0]) == len(call_args[1]) == 3 | ||
|
||
put_mock.reset_mock() | ||
|
||
mock_client.apply(snap, sequential=True) | ||
assert put_mock.call_count == 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters