Merge branch 'codex/review-native-backend' into codex/review-ui-integration
This commit is contained in:
commit
3c1998f2ef
1 file changed
+5
-5
@@ -1,5 +1,6 @@
|
||||
import json
|
||||
from dataclasses import replace
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -60,18 +61,17 @@ def test_management_preserves_release_context_before_first_native_call(setup, mo
|
||||
|
||||
|
||||
def test_management_records_scoped_changes_without_hashing_unrelated_cbb(setup, monkeypatch):
|
||||
from cbb_refresh_verify import scoped_manifest
|
||||
request, adapter, _ = setup
|
||||
root = request.library.parent
|
||||
target = root/'ReusableBlocksLP/Block/Work/Block.prj'
|
||||
deleted = root/'ReusableBlocksLP/Block/Work/obsolete.dat'; deleted.write_bytes(b'old')
|
||||
shared = root/'SymbolLibs/shared/icdb.dat'; shared.parent.mkdir(parents=True); shared.write_bytes(b'old')
|
||||
foreign = root/'ReusableBlocksLP/Other/Work/private.dat'; foreign.parent.mkdir(parents=True); foreign.write_bytes(b'other')
|
||||
original_hash = scoped_manifest.hash_file
|
||||
def hashed(path):
|
||||
original_open = Path.open
|
||||
def opened(path, *args, **kwargs):
|
||||
assert path != foreign, 'Post-write report must not add whole-library hashing'
|
||||
return original_hash(path)
|
||||
monkeypatch.setattr(scoped_manifest, 'hash_file', hashed)
|
||||
return original_open(path, *args, **kwargs)
|
||||
monkeypatch.setattr(Path, 'open', opened)
|
||||
remove = adapter.remove
|
||||
def mutate(req, evidence):
|
||||
target.write_bytes(target.read_bytes()+b'# updated\n')
|
||||
|
||||
Reference in new issue
Block a user