Rename to stealergram, add pyproject.toml, purge em-dashes
- Rename project to stealergram throughout - Add pyproject.toml (replaces requirements.txt split, folds pytest.ini) - Replace all em-dashes with hyphens across all source files Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
"""
|
||||
Tests for core/processor.py — archive extraction and line-by-line search.
|
||||
Tests for core/processor.py - archive extraction and line-by-line search.
|
||||
|
||||
No Telegram deps, no async. Tests create real archive fixtures in tmp_path
|
||||
so process_file's cleanup guarantee can be verified against actual disk state.
|
||||
@@ -60,7 +60,7 @@ class TestSearchFile:
|
||||
assert search_file(f, patterns) == ["testcorp.com|user|pass"]
|
||||
|
||||
def test_handles_encoding_errors_gracefully(self, tmp_path, patterns):
|
||||
"""Combo files are often messy — invalid bytes must not crash the search."""
|
||||
"""Combo files are often messy - invalid bytes must not crash the search."""
|
||||
f = tmp_path / "combo.txt"
|
||||
f.write_bytes(
|
||||
b"testcorp.com|user1|pass\n"
|
||||
@@ -81,7 +81,7 @@ class TestSearchFile:
|
||||
assert len(hits) == 2
|
||||
|
||||
|
||||
# ─── process_file — plain .txt ────────────────────────────────────────────────
|
||||
# ─── process_file - plain .txt ────────────────────────────────────────────────
|
||||
|
||||
class TestProcessFilePlainText:
|
||||
def test_returns_hits(self, tmp_path, patterns):
|
||||
@@ -104,7 +104,7 @@ class TestProcessFilePlainText:
|
||||
assert not f.exists()
|
||||
|
||||
|
||||
# ─── process_file — .zip extraction ──────────────────────────────────────────
|
||||
# ─── process_file - .zip extraction ──────────────────────────────────────────
|
||||
|
||||
class TestProcessFileZip:
|
||||
def _make_zip(self, tmp_path: Path, content: str, filename="content.txt") -> Path:
|
||||
@@ -155,7 +155,7 @@ class TestProcessFileZip:
|
||||
assert len(hits) == 2
|
||||
|
||||
|
||||
# ─── process_file — nested archives ──────────────────────────────────────────
|
||||
# ─── process_file - nested archives ──────────────────────────────────────────
|
||||
|
||||
class TestProcessFileNested:
|
||||
def test_nested_zip_is_recursed(self, tmp_path, patterns):
|
||||
@@ -177,7 +177,7 @@ class TestProcessFileNested:
|
||||
assert not (tmp_path / "outer").exists()
|
||||
|
||||
|
||||
# ─── process_file — password-protected .7z ───────────────────────────────────
|
||||
# ─── process_file - password-protected .7z ───────────────────────────────────
|
||||
|
||||
class TestProcessFile7zPassword:
|
||||
def test_unlocks_with_correct_password(self, tmp_path, patterns, monkeypatch):
|
||||
@@ -218,6 +218,6 @@ class TestProcessFile7zPassword:
|
||||
z.write(txt, "content.txt")
|
||||
txt.unlink()
|
||||
|
||||
# No hits — archive could not be opened
|
||||
# No hits - archive could not be opened
|
||||
hits = process_file(szf, patterns)
|
||||
assert hits == []
|
||||
|
||||
Reference in New Issue
Block a user