Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /Consiliency_treesitter-chunker /tests /test_boundary_cache_key.py
| from chunker.boundary import adapter | |
| def _payload() -> dict: | |
| return adapter._cache_key_payload( | |
| display_path="app.py", | |
| content_hash="sha1:content", | |
| language="python", | |
| resolution_mode="permissive", | |
| fail_fast=False, | |
| ) | |
| def test_boundary_cache_key_includes_pack_and_runtime_versions(monkeypatch): | |
| versions = { | |
| "tree-sitter-language-pack": "0.9.0", | |
| "tree-sitter": "0.25.2", | |
| } | |
| monkeypatch.setattr(adapter, "version", versions.__getitem__) | |
| first = _payload() | |
| assert first["grammar_version"] == "tree-sitter-python:pack=0.9.0:runtime=0.25.2" | |
| assert first["runtime_version"] == "0.25.2" | |
| assert adapter._build_boundary_cache_key( | |
| first | |
| ) == adapter._build_boundary_cache_key(_payload()) | |
| versions["tree-sitter-language-pack"] = "0.9.1" | |
| pack_changed = _payload() | |
| assert adapter._build_boundary_cache_key( | |
| pack_changed | |
| ) != adapter._build_boundary_cache_key(first) | |
| versions["tree-sitter"] = "0.25.3" | |
| runtime_changed = _payload() | |
| assert adapter._build_boundary_cache_key( | |
| runtime_changed | |
| ) != adapter._build_boundary_cache_key(pack_changed) | |
Xet Storage Details
- Size:
- 1.19 kB
- Xet hash:
- dd0deeff01d2dcd0f7f0fd87a630f3caf9e6b4fdef90c50fd86ebeaa50903b9b
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.