[WIP] Lingo: Plain Variable Assignments#3673
[WIP] Lingo: Plain Variable Assignments#3673KPrasch wants to merge 9 commits intonucypher:v7.7.xfrom
Conversation
Update BaseExecConditionDict and SigningObjectAttributeCondition TypedDict classes to use NotRequired for returnValueTest field. This is a type-only change preparing for optional returnValueTest support in condition variables.
When validating objects created via Python constructor (not from user JSON), set direct_construction flag so schemas can allow optional fields like returnValueTest to be None.
Update ConditionVariable.Schema to set in_condition_variable flag during deserialization, and update _ConditionField to propagate this context to nested condition schemas. This allows conditions inside ConditionVariable to have optional returnValueTest. Also update ExecutionCallCondition to make returnValueTest optional when inside a ConditionVariable or when directly constructed.
Update ContextVariableCondition, JsonCondition, and SigningObjectAttributeCondition to allow returnValueTest to be omitted when inside a ConditionVariable or when directly constructed. When returnValueTest is None, verify() returns (True, value), treating successful extraction as a passing condition.
Update RPCCondition, ContractCondition, TimeCondition, and BaseJsonRequestCondition to handle None returnValueTest: - Skip return type validation when returnValueTest is None - Return (True, result) from verify() when no test is defined - Update TimeCondition repr and timestamp property for None case
Test that conditions inside ConditionVariable can omit returnValueTest for pure value extraction, while standalone conditions still require it. Covers JsonCondition, ContextVariableCondition, SequentialCondition, operations, and serialization roundtrips.
Convert unittest-style test class to pytest standard format to match the rest of the test file. Moved inline imports to top of file. Fixed incorrect assertion in test_json_condition_without_return_value_test_with_operations.
- test_context_var_condition.py: Update to reflect that direct construction without returnValueTest is now allowed, but from_dict (standalone) still requires it - test_optional_return_value_test.py: Fix invalid string values in ReturnValueTest that don't pass ast.literal_eval
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## v7.7.x #3673 +/- ##
==========================================
- Coverage 86.72% 86.63% -0.10%
==========================================
Files 151 151
Lines 15270 15330 +60
==========================================
+ Hits 13243 13281 +38
- Misses 2027 2049 +22
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Convert unittest-style test classes to module-level functions to match project conventions. Tests are now organized with comment section headers instead of class groupings.
|
Interesting. Still processing but some things that jump out at me:
|
Type of PR:
Feature
Required reviews:
2