feat: bind native CRUD to prepared engine identity transactions
This commit is contained in:
1 parent
89500cbb5f
commit
55a82fdc5f
8 files changed
+492
-13
No files matched your search
@@ -24,6 +24,24 @@ def test_public_add_cannot_bypass_disabled_capability(tmp_path, monkeypatch):
|
||||
assert not result.success and result.safe_to_continue
|
||||
|
||||
|
||||
def test_empty_fixture_creation_uses_existing_new_library_guard_route(tmp_path, monkeypatch):
|
||||
import cbb_refresh_verify.native_management as native
|
||||
seen = []
|
||||
monkeypatch.setattr(native.NativeManagementAdapter, '_binary_capability', lambda _: '')
|
||||
monkeypatch.setattr(native.NativeManagementAdapter, '_worker',
|
||||
lambda adapter, job, evidence: (seen.append((job, evidence)) or
|
||||
{'success': True, 'safe_to_continue': True, 'entries': []}))
|
||||
root = tmp_path/'fresh'
|
||||
result = native.create_owned_fixture(root)
|
||||
assert result['success'] and result['entries'] == []
|
||||
assert seen[0][0]['operation'] == 'probe_create'
|
||||
assert Path(seen[0][0]['library']) == root/'native-add/fixture/mentor_lib.lmc'
|
||||
assert seen[0][0]['probe_token'] == result['probe_token']
|
||||
existing = tmp_path/'existing'; existing.mkdir()
|
||||
with pytest.raises(ValueError): native.create_owned_fixture(existing)
|
||||
assert len(seen) == 1
|
||||
|
||||
|
||||
def test_unprepared_add_rejected_before_native_activation(tmp_path, monkeypatch):
|
||||
import cbb_refresh_verify.native_management as native
|
||||
import win32com.client
|
||||
|
||||
Reference in new issue
Block a user