summaryrefslogtreecommitdiff
path: root/test_quick.py
diff options
context:
space:
mode:
authorroberto berto <rberto@deepcausa.com>2025-11-02 22:54:44 +0000
committerroberto berto <rberto@deepcausa.com>2025-11-02 22:54:44 +0000
commit6b4e9015744ab8c9f17a6b8e23387cd676b1d827 (patch)
tree4c0a634730df2123ff506252cbec050de006dac8 /test_quick.py
parent1ada32975f0bb559ec7526e0dd545700dde1cb94 (diff)
downloadpyvyos-feat/architecture-and-quality-improvements.tar.gz
pyvyos-feat/architecture-and-quality-improvements.zip
feat: v0.4.0 - Architecture refactor, bug fixes, and quality improvementsfeat/architecture-and-quality-improvements
- Fixed #25: config_file_save/load now include path: [] in payload - Added exception hierarchy (SDKError, HttpError, ApiError, ValidationError) - Added utility functions (json, ids, paths) - Added structured logging with request ID tracking - Added optional Pydantic validation models - Refactored to pyvyos.core.* structure with backward compatibility shims - Moved JSON specs to docs/development/vyos_api/ - Added comprehensive test suite (19 shim tests, 16 utils tests, 6 exception tests) - Updated pyproject.toml for uv sync editable installation - Added development documentation (architecture, roadmap, quality guidelines) Maintains 100% backward compatibility with 0.3.0
Diffstat (limited to 'test_quick.py')
-rw-r--r--test_quick.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/test_quick.py b/test_quick.py
new file mode 100644
index 0000000..9e93ca6
--- /dev/null
+++ b/test_quick.py
@@ -0,0 +1,40 @@
+#!/usr/bin/env python3
+"""Quick test script to verify imports and shims work."""
+
+def test_imports():
+ """Test all import paths."""
+ print("Testing imports...")
+
+ # Public API
+ from pyvyos import VyDevice, ApiResponse
+ print("✓ Public API imports work")
+
+ # Shim modules
+ from pyvyos.device import VyDevice as DeviceShim
+ from pyvyos.rest import RestClient, ApiResponse as RestResponse
+ print("✓ Shim module imports work")
+
+ # Core modules
+ from pyvyos.core.device import VyDevice as CoreDevice
+ from pyvyos.core.rest_client import RestClient as CoreRestClient
+ print("✓ Core module imports work")
+
+ # Identity checks
+ assert DeviceShim is VyDevice, "Device shim identity failed"
+ assert RestResponse is ApiResponse, "Rest shim identity failed"
+ assert CoreDevice is VyDevice, "Core device identity failed"
+ print("✓ All identity checks pass")
+
+ # Utils
+ from pyvyos.utils import redact_key, request_id, build_path
+ print("✓ Utils imports work")
+
+ # Exceptions
+ from pyvyos.exceptions import SDKError, HttpError, ApiError, ValidationError
+ print("✓ Exceptions imports work")
+
+ print("\n✅ All imports and shims working correctly!")
+
+if __name__ == "__main__":
+ test_imports()
+