Address code review feedback - improve test robustness and documentation clarity

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-11-07 16:23:34 +00:00
parent da8089aaac
commit c17dbdc28f
2 changed files with 15 additions and 8 deletions

View File

@ -343,6 +343,10 @@ This architecture ensures consistency between JavaScript and Python APIs.
## See Also
- [JavaScript API Documentation](./client.js)
- [Sample Python Script](../../sample/ql_sample.py)
- [Sample JavaScript Script](../../sample/ql_sample.js)
For more information and examples:
- [JavaScript API Client Source](./client.js) - The underlying Node.js gRPC client
- [Python Sample Script](../../sample/ql_sample.py) - Example Python script using QLAPI
- [JavaScript Sample Script](../../sample/ql_sample.js) - Example JavaScript script for comparison
These files are located in the Qinglong repository under `shell/preload/` and `sample/` directories.

View File

@ -61,9 +61,11 @@ def test_baseapi_inheritance():
assert callable(api.notify), "BaseApi.notify is not callable"
print(" ✓ notify is accessible")
# Verify getEnvs signature
assert 'params' in api.getEnvs.__annotations__, "getEnvs missing params annotation"
print(" ✓ getEnvs has correct signature")
# Verify getEnvs has type annotations (either params or return)
annotations = api.getEnvs.__annotations__
assert len(annotations) > 0, "getEnvs should have type annotations"
assert 'return' in annotations, "getEnvs should have return type annotation"
print(" ✓ getEnvs has correct signature with type annotations")
print("\n✓ BaseApi properly inherits from Client and adds notify method")
return True
@ -77,8 +79,9 @@ def test_method_signatures():
# Test getEnvs signature
getEnvs_annotations = client.getEnvs.__annotations__
assert 'params' in getEnvs_annotations or 'return' in getEnvs_annotations, \
"getEnvs missing annotations"
# Check that annotations exist - could be 'params', or just 'return'
assert len(getEnvs_annotations) > 0, "getEnvs should have type annotations"
assert 'return' in getEnvs_annotations, "getEnvs should have return type annotation"
print(" ✓ getEnvs has type annotations")
# Test other critical methods