summaryrefslogtreecommitdiff
path: root/tests/utils
diff options
context:
space:
mode:
authorRoberto Bertó <463349+robertoberto@users.noreply.github.com>2026-05-19 02:32:04 +0000
committerRoberto Bertó <463349+robertoberto@users.noreply.github.com>2026-05-19 02:32:04 +0000
commit0f76bcc7179976e893b1d9f296b1b1e7988b0031 (patch)
tree87fa89da92263bbe2af7303a0ab36433fdc6f5d3 /tests/utils
parentffd5ba16eb1ada42a582db4ac8bdaf29f66a868f (diff)
downloadpyvyos-0f76bcc7179976e893b1d9f296b1b1e7988b0031.tar.gz
pyvyos-0f76bcc7179976e893b1d9f296b1b1e7988b0031.zip
refactor: remove unused specs, exceptions, and request_id
The pyvyos.specs Pydantic models were never imported by the runtime and had 0% test coverage. The pyvyos.exceptions hierarchy was defined but never raised anywhere. The request_id helper generated UUIDs that were attached to log records but never propagated to callers — half-implemented tracing is worse than none. This commit does not alter request/response logic or HTTP payloads. It only removes code that was never executed and tests for that code. Removed: - pyvyos/specs/ (Pydantic models package) - pyvyos/exceptions.py (SDKError, HttpError, ApiError, ValidationError) - pyvyos/utils/ids.py (request_id helper) - tests/test_exceptions.py - tests/utils/test_ids.py Edited: - pyvyos/core/rest_client.py: drop request_id import and log extras - pyvyos/utils/__init__.py: drop request_id export Tests: 66 -> 57 passing. Coverage: 54% -> 87%. Public API unchanged.
Diffstat (limited to 'tests/utils')
-rw-r--r--tests/utils/test_ids.py25
1 files changed, 0 insertions, 25 deletions
diff --git a/tests/utils/test_ids.py b/tests/utils/test_ids.py
deleted file mode 100644
index 19ff3a7..0000000
--- a/tests/utils/test_ids.py
+++ /dev/null
@@ -1,25 +0,0 @@
-"""Tests for pyvyos.utils.ids module."""
-
-import uuid
-
-from pyvyos.utils.ids import request_id
-
-
-def test_request_id_returns_string():
- """Test that request_id returns a string."""
- rid = request_id()
- assert isinstance(rid, str)
-
-
-def test_request_id_valid_uuid():
- """Test that request_id returns a valid UUID."""
- rid = request_id()
- uuid.UUID(rid) # Should not raise
-
-
-def test_request_id_unique():
- """Test that request_id generates unique IDs."""
- id1 = request_id()
- id2 = request_id()
- assert id1 != id2
-