File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- """Unit tests for _types.py — PropertyValue conversion round-trips."""
1+ """Unit tests for _types.py — PropertyValue conversion round-trips.
2+
3+ TestFromPropertyValue: pure mock-based, runs without proto stubs.
4+ TestToPropertyValue: requires generated proto stubs (make proto).
5+ Tests are skipped automatically when stubs are absent.
6+ """
27
38import pytest
49
510from coordinode ._types import from_property_value , to_property_value
611
12+ # Detect whether proto stubs have been generated.
13+ try :
14+ from coordinode ._proto .coordinode .v1 .common .types_pb2 import PropertyValue # noqa: F401
15+ _HAS_PROTO = True
16+ except ImportError :
17+ _HAS_PROTO = False
18+
19+ _requires_proto = pytest .mark .skipif (
20+ not _HAS_PROTO ,
21+ reason = "Proto stubs not generated — run `make proto` first" ,
22+ )
23+
724
825class _FakeVec :
926 """Minimal PropertyValue.vector stub."""
@@ -67,6 +84,7 @@ def map_value(self):
6784
6885# ── to_property_value ───────────────────────────────────────────────────────
6986
87+ @_requires_proto
7088class TestToPropertyValue :
7189 def test_int (self ):
7290 pv = to_property_value (42 )
You can’t perform that action at this time.
0 commit comments