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
|
import json
|
||||||
from dataclasses import replace
|
from dataclasses import replace
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
import pytest
|
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):
|
def test_management_records_scoped_changes_without_hashing_unrelated_cbb(setup, monkeypatch):
|
||||||
from cbb_refresh_verify import scoped_manifest
|
|
||||||
request, adapter, _ = setup
|
request, adapter, _ = setup
|
||||||
root = request.library.parent
|
root = request.library.parent
|
||||||
target = root/'ReusableBlocksLP/Block/Work/Block.prj'
|
target = root/'ReusableBlocksLP/Block/Work/Block.prj'
|
||||||
deleted = root/'ReusableBlocksLP/Block/Work/obsolete.dat'; deleted.write_bytes(b'old')
|
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')
|
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')
|
foreign = root/'ReusableBlocksLP/Other/Work/private.dat'; foreign.parent.mkdir(parents=True); foreign.write_bytes(b'other')
|
||||||
original_hash = scoped_manifest.hash_file
|
original_open = Path.open
|
||||||
def hashed(path):
|
def opened(path, *args, **kwargs):
|
||||||
assert path != foreign, 'Post-write report must not add whole-library hashing'
|
assert path != foreign, 'Post-write report must not add whole-library hashing'
|
||||||
return original_hash(path)
|
return original_open(path, *args, **kwargs)
|
||||||
monkeypatch.setattr(scoped_manifest, 'hash_file', hashed)
|
monkeypatch.setattr(Path, 'open', opened)
|
||||||
remove = adapter.remove
|
remove = adapter.remove
|
||||||
def mutate(req, evidence):
|
def mutate(req, evidence):
|
||||||
target.write_bytes(target.read_bytes()+b'# updated\n')
|
target.write_bytes(target.read_bytes()+b'# updated\n')
|
||||||
|
|||||||
Reference in new issue
Block a user