mirror of
https://github.com/whyour/qinglong.git
synced 2025-11-09 16:16:07 +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
|
## See Also
|
||||||
|
|
||||||
- [JavaScript API Documentation](./client.js)
|
For more information and examples:
|
||||||
- [Sample Python Script](../../sample/ql_sample.py)
|
|
||||||
- [Sample JavaScript Script](../../sample/ql_sample.js)
|
- [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"
|
assert callable(api.notify), "BaseApi.notify is not callable"
|
||||||
print(" ✓ notify is accessible")
|
print(" ✓ notify is accessible")
|
||||||
|
|
||||||
# Verify getEnvs signature
|
# Verify getEnvs has type annotations (either params or return)
|
||||||
assert 'params' in api.getEnvs.__annotations__, "getEnvs missing params annotation"
|
annotations = api.getEnvs.__annotations__
|
||||||
print(" ✓ getEnvs has correct signature")
|
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")
|
print("\n✓ BaseApi properly inherits from Client and adds notify method")
|
||||||
return True
|
return True
|
||||||
|
|
@ -77,8 +79,9 @@ def test_method_signatures():
|
||||||
|
|
||||||
# Test getEnvs signature
|
# Test getEnvs signature
|
||||||
getEnvs_annotations = client.getEnvs.__annotations__
|
getEnvs_annotations = client.getEnvs.__annotations__
|
||||||
assert 'params' in getEnvs_annotations or 'return' in getEnvs_annotations, \
|
# Check that annotations exist - could be 'params', or just 'return'
|
||||||
"getEnvs missing annotations"
|
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")
|
print(" ✓ getEnvs has type annotations")
|
||||||
|
|
||||||
# Test other critical methods
|
# Test other critical methods
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user