Conversation
niamhdougan
commented
Feb 18, 2026
- Makes api version configurable on the command line (defaults to 1.8.0)
- access_mode is now optional to handle 1.6.0 responses, setting it accordingly depending on mode of subsystem
- Added api version as a type to remove duplication - Updated tests to reflect changes
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #89 +/- ##
==========================================
+ Coverage 84.93% 85.03% +0.09%
==========================================
Files 13 13
Lines 405 421 +16
==========================================
+ Hits 344 358 +14
- Misses 61 63 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
GDYendell
left a comment
There was a problem hiding this comment.
A couple of comments.
The coverage is fine for this change except for the one line in eiger_subsystem_controller. Could you create a test_eiger_parameter.py with a test that checks what access mode is returned for different cases? It will look something like:
ref = EigerParameterRef(response=EigerParameterResponse.model_validate(<response>), mode=<mode>)
assert ref.access_mode == <expected_access_mode>It can be a parameterized test like here with different cases, e.g.
- response =
{"access_mode": "r", ...}-> "r" - response =
{"access_mode": "rw", ...}-> "rw" - response =
{<no access_mode>}, mode="status" -> "r" - response =
{<no access_mode>}, mode="config" -> "rw"
You might want to create the response in the function and just parameterize access_mode if that ends up being a lot of duplicated dictionaries.
| attributes: dict[str, Attribute] = {} | ||
| for parameter in parameters: | ||
| group = cls._group(parameter) | ||
| match parameter.response.access_mode: |
There was a problem hiding this comment.
We need to use the new access_mode property here so that we create attributes for 1.6.0 parameters.
| match parameter.access_mode: |
There was a problem hiding this comment.
This hasn't appeared very clearly...
See the snippet above the comment:
match parameter.response.access_mode: -> match parameter.access_mode:
| return String() | ||
|
|
||
| @property | ||
| def response_access_mode(self) -> Literal["r", "w", "rw"] | None: |
There was a problem hiding this comment.
Hide the implementation detail here
| def response_access_mode(self) -> Literal["r", "w", "rw"] | None: | |
| def access_mode(self) -> Literal["r", "w", "rw"] | None: |