diff --git a/shell/preload/README_PYTHON_API.md b/shell/preload/README_PYTHON_API.md index 0e88220e..8abbb662 100644 --- a/shell/preload/README_PYTHON_API.md +++ b/shell/preload/README_PYTHON_API.md @@ -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. diff --git a/shell/preload/test_client.py b/shell/preload/test_client.py index 4306cdc7..b04f3ae1 100644 --- a/shell/preload/test_client.py +++ b/shell/preload/test_client.py @@ -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