merge: sync with origin/main, take upstream on conflicts
# Conflicts: # admin-compliance/lib/sdk/types.ts # admin-compliance/lib/sdk/vendor-compliance/types.ts
This commit is contained in:
@@ -57,8 +57,21 @@ TENANT_ID = "default"
|
||||
|
||||
|
||||
class _DictRow(dict):
|
||||
"""Dict wrapper that mimics PostgreSQL's dict-like row access for SQLite."""
|
||||
pass
|
||||
"""Dict wrapper that mimics PostgreSQL's dict-like row access for SQLite.
|
||||
|
||||
Provides a ``_mapping`` property (returns self) so that production code
|
||||
such as ``row._mapping["id"]`` works, and supports integer indexing via
|
||||
``row[0]`` which returns the first value (used as fallback in create_dsfa).
|
||||
"""
|
||||
|
||||
@property
|
||||
def _mapping(self):
|
||||
return self
|
||||
|
||||
def __getitem__(self, key):
|
||||
if isinstance(key, int):
|
||||
return list(self.values())[key]
|
||||
return super().__getitem__(key)
|
||||
|
||||
|
||||
class _DictSession:
|
||||
@@ -512,9 +525,7 @@ class TestDsfaToResponse:
|
||||
"metadata": {},
|
||||
}
|
||||
defaults.update(overrides)
|
||||
row = MagicMock()
|
||||
row.__getitem__ = lambda self, key: defaults[key]
|
||||
return row
|
||||
return _DictRow(defaults)
|
||||
|
||||
def test_basic_fields(self):
|
||||
row = self._make_row()
|
||||
@@ -629,7 +640,7 @@ class TestDSFARouterConfig:
|
||||
assert "compliance-dsfa" in dsfa_router.tags
|
||||
|
||||
def test_router_registered_in_init(self):
|
||||
from compliance.api import dsfa_router as imported_router
|
||||
from compliance.api.dsfa_routes import router as imported_router
|
||||
assert imported_router is not None
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user