Test hardening (Codex code-review findings across 8 test files): - OpenClawGatewayClientTests: constructor tests now verify URL normalization instead of just NotNull; renamed misleading GetSessionList_SortsMainSessionFirst to _ReturnsEmpty_ForFreshClient - ExecApprovalPolicyTests: ExecApprovalsGet now deserializes and asserts enabled/defaultAction/rules fields; WithoutPolicy test verifies enabled=false - CapabilityTests: screen list test validates screens[] array fields (name/primary/bounds); camera list validates cameras[] entries (DeviceId/Name/IsDefault); error-path tests assert 'not available' error message - NodeCapabilitiesTests: ExecuteAsync verifies payload echoes command; CanSet verifies payload value; added Int32 overflow test - DeviceIdentityTests: signature length tightened from >40 to ==86; public key test decodes base64url and asserts 32-byte Ed25519 length - GatewayUrlHelperTests: added malformed percent-encoding negative tests; tightened ValidationMessage assertion - ReadmeValidationTests: validates ALL matching allowCommands JSON blocks, not just first - ModelsTests: replaced overly permissive OR assertion with platform-aware exact checks Production fix: - NodeCapabilities.GetIntArg: catch FormatException on Int32 overflow and return default value instead of throwing |
||
|---|---|---|
| .. | ||
| OpenClaw.Shared.Tests | ||
| OpenClaw.Tray.Tests | ||