v2.17.0 (#822)
Co-authored-by: Clément Sirieix <clement.sirieix@mistral.ai> Co-authored-by: Guillaume LE GOFF <guillaume.lgf@gmail.com> Co-authored-by: Hdandria <henri.dandria@mistral.ai> Co-authored-by: Ivana Dunisijevic <ivana.dunisijevic@mistral.ai> Co-authored-by: Jean Burellier <sheplu@users.noreply.github.com> Co-authored-by: Mathias Gesbert <mathias.gesbert@mistral.ai> Co-authored-by: Mert Unsal <mert.unsal@mistral.ai> Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com> Co-authored-by: Paul VEZIA <166131032+le-codeur-rapide@users.noreply.github.com> Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai> Co-authored-by: Val <102326092+vdeva@users.noreply.github.com> Co-authored-by: Vincent G <10739306+VinceOPS@users.noreply.github.com> Co-authored-by: renovate-mistral[bot] <253709520+renovate-mistral[bot]@users.noreply.github.com> Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
parent
564a14365e
commit
6bedf271ce
223 changed files with 10533 additions and 6947 deletions
|
|
@ -4,7 +4,11 @@ from pathlib import Path
|
|||
|
||||
import pytest
|
||||
|
||||
from vibe.core.config.fingerprint import capture_stable_file, create_dict_fingerprint
|
||||
from vibe.core.config.fingerprint import (
|
||||
capture_stable_file,
|
||||
create_dict_fingerprint,
|
||||
create_file_fingerprint,
|
||||
)
|
||||
from vibe.core.config.types import ConcurrencyConflictError
|
||||
|
||||
|
||||
|
|
@ -67,6 +71,32 @@ class TestCaptureStableFile:
|
|||
pass
|
||||
|
||||
|
||||
class TestCreateFileFingerprint:
|
||||
def test_captures_file_state(self, tmp_working_directory: Path) -> None:
|
||||
path = tmp_working_directory / "config.toml"
|
||||
path.write_text("key = 1")
|
||||
|
||||
with path.open("rb") as file:
|
||||
first_fingerprint = create_file_fingerprint(file)
|
||||
with path.open("rb") as file:
|
||||
second_fingerprint = create_file_fingerprint(file)
|
||||
|
||||
assert isinstance(first_fingerprint, str)
|
||||
assert first_fingerprint
|
||||
assert first_fingerprint == second_fingerprint
|
||||
|
||||
def test_changes_when_file_changes(self, tmp_working_directory: Path) -> None:
|
||||
path = tmp_working_directory / "config.toml"
|
||||
path.write_text("key = 1")
|
||||
with path.open("rb") as file:
|
||||
first_fingerprint = create_file_fingerprint(file)
|
||||
|
||||
path.write_text("key = 2")
|
||||
|
||||
with path.open("rb") as file:
|
||||
assert create_file_fingerprint(file) != first_fingerprint
|
||||
|
||||
|
||||
class TestCreateDictFingerprint:
|
||||
def test_empty_dict_returns_stable_non_empty_token(self) -> None:
|
||||
first_fingerprint = create_dict_fingerprint({})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue