From 6b4e9015744ab8c9f17a6b8e23387cd676b1d827 Mon Sep 17 00:00:00 2001 From: roberto berto Date: Sun, 2 Nov 2025 22:54:44 +0000 Subject: feat: v0.4.0 - Architecture refactor, bug fixes, 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 --- tests/utils/test_paths.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/utils/test_paths.py (limited to 'tests/utils/test_paths.py') diff --git a/tests/utils/test_paths.py b/tests/utils/test_paths.py new file mode 100644 index 0000000..e85f7d0 --- /dev/null +++ b/tests/utils/test_paths.py @@ -0,0 +1,34 @@ +"""Tests for pyvyos.utils.paths module.""" + +from pyvyos.utils.paths import build_path + + +def test_build_path_strings(): + """Test building path from string segments.""" + result = build_path("interfaces", "ethernet", "eth0") + assert result == ["interfaces", "ethernet", "eth0"] + + +def test_build_path_mixed(): + """Test building path from mixed strings and lists.""" + result = build_path(["interfaces", "ethernet"], "eth0", "address") + assert result == ["interfaces", "ethernet", "eth0", "address"] + + +def test_build_path_empty(): + """Test building path with no arguments.""" + result = build_path() + assert result == [] + + +def test_build_path_single_list(): + """Test building path with single list.""" + result = build_path(["interfaces", "ethernet"]) + assert result == ["interfaces", "ethernet"] + + +def test_build_path_multiple_lists(): + """Test building path with multiple lists.""" + result = build_path(["interfaces"], ["ethernet"], ["eth0"]) + assert result == ["interfaces", "ethernet", "eth0"] + -- cgit v1.2.3