hkuds--deeptutor
e4dcfc49aa
Tests / Import Check (Python 3.13) (push) Has been cancelled
Tests / Import Check (Python 3.14) (push) Has been cancelled
Tests / Python Tests (Python 3.11) (push) Has been cancelled
Tests / Python Tests (Python 3.12) (push) Has been cancelled
Tests / Python Tests (Python 3.14) (push) Has been cancelled
Tests / Test Summary (push) Has been cancelled
Tests / Lint and Format (push) Has been cancelled
Tests / Web Node Tests (push) Has been cancelled
Tests / Import Check (Python 3.11) (push) Has been cancelled
Tests / Import Check (Python 3.12) (push) Has been cancelled
Tests / Python Tests (Python 3.13) (push) Has been cancelled
23 行
897 B
Python
23 行
897 B
Python
from __future__ import annotations
|
|
|
|
from deeptutor.services.parsing.signature import ParserSignature
|
|
|
|
|
|
def test_hash_is_order_independent() -> None:
|
|
a = ParserSignature.build("mineru", "2.0", {"mode": "local", "lang": "en"})
|
|
b = ParserSignature.build("mineru", "2.0", {"lang": "en", "mode": "local"})
|
|
assert a.hash() == b.hash()
|
|
|
|
|
|
def test_hash_changes_with_params_version_and_engine() -> None:
|
|
base = ParserSignature.build("mineru", "2.0", {"mode": "local"})
|
|
assert base.hash() != ParserSignature.build("mineru", "2.0", {"mode": "cloud"}).hash()
|
|
assert base.hash() != ParserSignature.build("mineru", "2.1", {"mode": "local"}).hash()
|
|
assert base.hash() != ParserSignature.build("docling", "2.0", {"mode": "local"}).hash()
|
|
|
|
|
|
def test_hash_is_short_hex() -> None:
|
|
h = ParserSignature.build("x", "1", {}).hash()
|
|
assert len(h) == 16
|
|
int(h, 16) # hex-decodable
|