mirror of
https://github.com/whyour/qinglong.git
synced 2025-11-08 15:06:08 +08:00
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:
parent
da8089aaac
commit
c17dbdc28f
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user