Livrare LOT 1 - Didi

This commit is contained in:
Dezvoltari Evotech 2026-06-25 14:13:25 -07:00
commit 5380c3fc63
990 changed files with 133308 additions and 0 deletions

View file

@ -0,0 +1,22 @@
"""ELA extractor tests."""
from __future__ import annotations
from extractors.features import ela
def test_ela_returns_stats(tmp_path, jpeg_bytes):
path = tmp_path / "img.jpg"
path.write_bytes(jpeg_bytes)
res = ela.extract(str(path))
assert res.ok is True
for key in ("mean_error", "max_error", "p99_error", "hot_pixel_fraction"):
assert key in res.results
assert 0.0 <= res.results["hot_pixel_fraction"] <= 1.0
def test_ela_on_bad_input(tmp_path):
path = tmp_path / "x.bin"
path.write_bytes(b"\x00\x01\x02")
res = ela.extract(str(path))
assert res.ok is False