Skip to content

Validate properties on assignment#278

Open
rwb27 wants to merge 2 commits intomainfrom
validate-properties-on-assignment
Open

Validate properties on assignment#278
rwb27 wants to merge 2 commits intomainfrom
validate-properties-on-assignment

Conversation

@rwb27
Copy link
Collaborator

@rwb27 rwb27 commented Mar 3, 2026

This makes use of the validation logic now added to PropertyInfo to validate properties when they are set from Python. Properties are already validated when set over HTTP.

I've added to existing tests to ensure that we test this in various ways, both by calling __set__ on a mocked Thing and in more realistic contexts.

I have not yet added a way to opt out of this behaviour other than by subclassing the property descriptor.

rwb27 added 2 commits March 3, 2026 14:36
This uses the existing validation logic in `PropertyInfo` to check assignments made in Python as well as set operations over HTTP.
@barecheck
Copy link

barecheck bot commented Mar 3, 2026

Barecheck - Code coverage report

Total: 96.52%

Your code coverage diff: 0.00% ▴

Uncovered files and lines
FileLines
src/labthings_fastapi/properties.py700, 704, 727-730, 802, 824, 1054

@rwb27 rwb27 added this to the v0.2.0 milestone Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant